Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Lexer and Folding For N++ (Finally!) - [Deprecated]


  • Please log in to reply
133 replies to this topic
jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
I noticed this is now available as a download in the Notepad++ plugins - very nice :D .

EDIT - Removed suggestion since it was inconsistent with other languages.

  • Guests
  • Last active:
  • Joined: --

Yes I will try to keep it up to date, or at least modify it until the people using it feels is ok. But I say I will TRY because I know crap about C++... :lol:

I am following the logic, copy pasting until everything makes sense, give it a try and voila. So dont feel that you cant help.

--> Note to anybody that codes in C++, If you have free time please lend me a hand to make this little bit better <--

Ok, Regarding the "[]" I think I know where the problem is, the ")" is ending the formatting, thats why it works fine on "collection("A")[5]" but as "Array" is a word and it is not clearing the default format the "[]" is not colorizing.

I think I will be able to fix that one pretty soon.

I am not sure but I think there was a case in AHK that you could call a label with :Label... probably for menus or something like that, I want to believe that PHiLho allowed that on purpose and that it is not a mistake, if I dont find the relevant information (or he says that it was a mistake) then I will do my best to fix it.

EDIT:
--Confirmed--
I think it is allow formating this:
"Menu, tray, add, This Menu Item Is A Submenu, :MySubmenu"

Concerning the ";***" and ";*" they are used by notepad++ by default on the User Defined Languages for allowing folding and some people have gotten used to them even though they really do not mean much to ahk.

I didnt expect much people to use that since you already have the /* */ and ; for commenting, they are just there to satisfy people that are already used to fold with comments with them, but probably I will follow the advice and make them similar to ;+ and ;- which even thought they fold, they do not color the code between them. It would be safer.

Thanks for pointing those bugs out, it helps improving this lexer. :D



hamlin
  • Guests
  • Last active:
  • Joined: --

Note:
* I compiled using version 5.4.3 Unicode of N++, even though there should be no problems, just post a message if you have issues or if you are using the ANSI version, so I can upload an update.

Hi RaptorX. I often have to debug/edit scripts on some w9x systems (which is one of the reasons I use NPP), so I would very much appreciate you compiling and posting an ANSI version when you can find the time.

Thanks for your work. :D

RaptorX
  • Members
  • 751 posts
  • Last active: Feb 19 2015 02:47 AM
  • Joined: 19 Feb 2010

Note:
* I compiled using version 5.4.3 Unicode of N++, even though there should be no problems, just post a message if you have issues or if you are using the ANSI version, so I can upload an update.

Hi RaptorX. I often have to debug/edit scripts on some w9x systems (which is one of the reasons I use NPP), so I would very much appreciate you compiling and posting an ANSI version when you can find the time.

Thanks for your work. :D


Uploaded the ANSI version, you can get it from here:
AHKExtLexer 1.2 (ANSI).

I tested it on the latest version of N++ so it should work fine, any issues just post back and I will try to fix them.

I will not update the ANSI version as often as the UNICODE but I will usually work on it if requested. So keep me informed of any issues or wish-list that you have.

guest3456
  • Guests
  • Last active:
  • Joined: --
thanks, this is great. is there auto-complete anywhere?

guest3456
  • Guests
  • Last active:
  • Joined: --

thanks, this is great. is there auto-complete anywhere?


duh, seems like its included, but i can't get it to work?

guest3456
  • Guests
  • Last active:
  • Joined: --

thanks, this is great. is there auto-complete anywhere?


duh, seems like its included, but i can't get it to work?


ok i'm retarded, i needed to enable the option in settings->preferences

now, when i type

InStr(

i get a tooltip with the parameters. is it possible to replicate that when i do this:

MsgBox, 


a4u
  • Guests
  • Last active:
  • Joined: --
Good Question - I always just type MsgBox(, - and then go back and delete the (

RaptorX
  • Members
  • 751 posts
  • Last active: Feb 19 2015 02:47 AM
  • Joined: 19 Feb 2010
Thanks guys for finding this out, I will be updating the Auto-Completion file to see if i can make it that commands work without the "(" but it may not be that easy because Auto-Completion is designed specifically for functions so it might be a little bit of a pain.

On the other hand I have been trying to fix other bugs related to the lexer itself, and trying to optimize the folding routines as well, so it might take a little time before that is fixed (if it is possible).

If there is anybody with C++ knowledge that is willing to help just PM me.

guest3456
  • Guests
  • Last active:
  • Joined: --
also another request

can we have Folding for subroutines?

perhaps fold from ":" to "return"

someSub:
   ;//some code
return



guest3456
  • Guests
  • Last active:
  • Joined: --
this code is not being detected as comments and coloring properly:

;{

;}


-RaptorX-
  • Guests
  • Last active:
  • Joined: --

this code is not being detected as comments and coloring properly:

;{

;}


actually they are not supposed to comment anything, I use them to fold code to make my script more readable, ex:

Posted Image


;{
;}
and
;+
;-

are simply for hiding code.

Maestr0
  • Members
  • 652 posts
  • Last active: Jan 04 2019 04:01 PM
  • Joined: 18 Oct 2008
great work, added it to all my notepad++ installs :D
will take some getting used to seeing as I switched from the api that came with autohotkey.
Will provide additional feedback if I find any.

RaptorX
  • Members
  • 751 posts
  • Last active: Feb 19 2015 02:47 AM
  • Joined: 19 Feb 2010

great work, added it to all my notepad++ installs :D
will take some getting used to seeing as I switched from the api that came with autohotkey.
Will provide additional feedback if I find any.


note that you can change the colors for the keywords on the "Style Configurator" to match what you had before or whatever you want for that matter. Hope to hear your feedback.

Maestr0
  • Members
  • 652 posts
  • Last active: Jan 04 2019 04:01 PM
  • Joined: 18 Oct 2008

great work, added it to all my notepad++ installs :D
will take some getting used to seeing as I switched from the api that came with autohotkey.
Will provide additional feedback if I find any.


note that you can change the colors for the keywords on the "Style Configurator" to match what you had before or whatever you want for that matter. Hope to hear your feedback.


yeah, saw that, thanks though :)

Now, my feedback:
- sometimes the highlighting of words does not work until they are separated from other words (like %destpath%\bla.txt did not highlight until I did %destpath% \bla.txt and then deleted the added space)
- notepad++ still uses the old api/lexer, maybe an install\update script is in order?