GithubHelp home page GithubHelp logo

chocobo1 / nppautodetectindent Goto Github PK

View Code? Open in Web Editor NEW
37.0 2.0 8.0 61 KB

Auto detect indention plugin for Notepad++

License: GNU General Public License v3.0

C++ 91.81% C 8.19%
notepadplusplus notepad-plusplus-plugin notepad-plus-plus plugin indention tabs spaces

nppautodetectindent's Introduction

Auto Detect Indention Plugin for Notepad++ AppVeyor build status

Detects indention (tab or spaces) and auto adjust Tab key on-the-fly

What It Does

Indention used in file Tab key
Tabs 1 tab
For example: 3 Spaces 3 spaces
Cannot determine Depends on Notepad++ settings

Installation

  1. If you are running Notepad++ 7.6 or later:
  2. If you are running Notepad++ version prior to 7.6:
    Download and extract the archive from below and move nppAutoDetectIndent.dll into Notepad++ plugin folder.
    • For Notepad++ x86: C:\Program Files (x86)\Notepad++\plugins \
    • For Notepad++ x64: C:\Program Files\Notepad++\plugins

Download

Releases page

Why

Many projects have differnet coding style requirements, some use tabs other prefer spaces.
And there is this holy war of tabs or spaces.

I first discovered this function in Geany editor: detecting-indent-type
I thought it's cool because you don't have to worry about having the correct settings in your editor nor need to care about setting up editorconfig, it just works!

Compiler

Visual Studio 2022 Community

License

See LICENSE file

nppautodetectindent's People

Contributors

chocobo1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nppautodetectindent's Issues

Need to ignore comment lines

Considering the following code snippet:

class Example {
    
    /**
     * demonstrate
     * Define a function 
     * in a class
     * with a long description
     *
     * @param String input
     * @return void
     */
    public function demonstrate(String $input) {
        return null;
    }
    
}

nppAutoDetectIndent will consider files looking like this to have 5-space indentation because that is the most common indentation depth per unqualified line. It should only be considering actual code lines, by excluding all comments (block or otherwise) and by extension lines that only consist of comments.

It would also be nice if we could override the derived value when said derivation is incorrect.

Amend documentation

Perhaos you could add in the readme that (when installing manually) you have to move the DLL into a subdir called 'nppAutoDetectIndent' for it to be loaded. Thanks for the great plugin!

Work with backspace too

Thanks for this great plugin, but what about remove characters? I'm using 2 spaces instead of tab, but Notepad++ don't understand it while backspace, so I compelled to press the backspace twice instead of once to remove characters. I hoped that yours plugin can do it out of the box( Do you planned to implement this? Thanks in advance.

Crash on Notepad++ 8.3

In case you missed it:

Due to the support 2GB files opening in Notepad++ v8.3 x64 build, the header Sci_Position.h in Notepad++ has been modified for adapting this need.
This change has caused the instability in some plugins.

The solution is quite simple - just replace Sci_Position.h by the new one.
ref:
https://community.notepad-plus-plus.org/topic/22471/recompile-your-x64-plugins-with-new-header

You will also need to update types throughout your code if you are referring to Scintilla positions and text ranges. Scintilla API calls that return positions should not use int but rather Sci_Position and text ranges should use Sci_PositionCR.

You use a text range for example in your code.

Sorry for the inconvenience and thank you for your help.

Cheers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.