Raised This Month: $51 Target: $400
 12% 

Notepad++ Smart Indentation Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 03-01-2013 , 13:35   Notepad++ Smart Indentation Plugin
Reply With Quote #1

It's a better one than in Arkshine's Notepad++ AlliedModders Edition, or rather a "better fitting for Pawn" one. Apparently it was originally made for C++ indentation, so it automatically put the text to the beginning of the line once you used a colon (":"). I removed that function and recompiled the plugin.

You can find the source code for the original NppAutoIndent here, I've just commented out this part:
PHP Code:
            case ':': {
            
//start searching for case/public/private keywords
            //Find the first keyword and compare
            
int i 0;
            while(
lineBuffer[i] == ' ' || lineBuffer[i] == '\t')
                
i++;
            
int start i;
            
char ch lineBuffer[i];
            while ( (
ch >= 'A' && ch <= 'Z' || ch >= 'a' && ch <= 'z' || ch >= '0' && ch <= '9' || ch == '_')) {
                
i++;
                
ch lineBuffer[i];
            }
            
lineBuffer[i] = 0;
            if (!
lstrcmpA(lineBuffer+start"case") || !lstrcmpA(lineBuffer+start"default"))
                return 
LineCase;
            else if (!
lstrcmpA(lineBuffer+start"public") || !lstrcmpA(lineBuffer+start"private"))
                return 
LineAccess;

            return 
LineLabel;
            break; } 
INSTALLATION: Exit Notepad++, place the DLL into your Notepad++/plugins folder, start Notepad++, go to Plugins → NppAutoIndent and select Smart Indent.
NOTE: I haven't tested this with Notepad++ AlliedModders Edition.
Attached Files
File Type: zip NppAutoIndent_Pawn.zip (153.1 KB, 832 views)
__________________
hleV is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-01-2013 , 21:45   Re: Notepad++ Smart Indentation Plugin
Reply With Quote #2

I just use the one that comes with TextFx.
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode