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
Maestr0
  • Members
  • 652 posts
  • Last active: Aug 17 2019 06:07 PM
  • Joined: 18 Oct 2008
As of this writing, version 6.1.3

  • Guests
  • Last active:
  • Joined: --
just tested this with the latest np++ 6.1.4 and it worked

simply had to replace the scilexer.dll and then drop Raptor's files in

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011

just tested this with the latest np++ 6.1.4 and it worked

simply had to replace the scilexer.dll and then drop Raptor's files in



actually, the folding doesn't seem to work. i dont see the +/- boxes with this latest 6.15

thesoupmeat
  • Members
  • 188 posts
  • Last active: Mar 10 2013 04:30 AM
  • Joined: 03 Jun 2010
how do i install this? i really want custom folding! see here: <!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?f=1&t=88955&p=551977#p551977">viewtopic.php?f=1&t=88955&p=551977#p551977</a><!-- l -->

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
folding used to work for me with notepad++ 5.8, but i dont think it ever worked with labels

thesoupmeat
  • Members
  • 188 posts
  • Last active: Mar 10 2013 04:30 AM
  • Joined: 03 Jun 2010
can we make the folding work with labels?
It just has to check for %word%: and stop at return
I think you can use the View -> User-Defined Dialog to do it but i have yet to be successful.

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
What about conditional return (i.e. under an IF statement)? There are also other ways that a sub can terminate, such as Exit, which might even be called indirectly via some other function.

Maestr0
  • Members
  • 652 posts
  • Last active: Aug 17 2019 06:07 PM
  • Joined: 18 Oct 2008
I think NP++ is used quite a bit, I think work on this would be greatly appreciated.

What about conditional return (i.e. under an IF statement)? There are also other ways that a sub can terminate, such as Exit, which might even be called indirectly via some other function.

Yes. Exitapp / return
Also, I don't see any folding in my NP++, not even with { }... did I miss a setting?

infogulch
  • Moderators
  • 717 posts
  • Last active: Jul 31 2014 08:27 PM
  • Joined: 27 Mar 2008

What about conditional return (i.e. under an IF statement)?


And what about multiple labels that start at different lines?

Perhaps folding can be done like this. Start folding on a label, and fold on the first occurrence of:
[*:3hz57su5]An unconditional return (or GoTo?)
[*:3hz57su5]The line above a new label (for an example, see ini file section folding).
[*:3hz57su5]The end of a block that encloses the label (think labels inside functions)

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
actually, folding is still working with this lexer in the latest NP++ ! for some reason it started working once i opened up a php file.

you can see example here:
<!-- m -->http://i.imgur.com/y0Mop.png<!-- m -->

its never worked for folding Labels though.

however, Raptor already has workarounds built in. its not elegant but it does work:

;+
    ; This can be used for folding lines of code that you want executed but
    ; want to be able to fold them. 

   MyFoldingLabel:
      put whatever you want
   return/Exit/ExitApp
;-


;{
    ; alternate method but i prefer the above
    ; sometimes i comment out legitimate braceblocks and this would confuse me
    code
;}


i was gonna say maybe we should fold based on indentation. python for example doesnt even use brackets, they base the whole structure of the lang on indentation. ppl would have to change the way they indent this though:

MyLabel:
   var := value
   if (var)
      return
MyLabel2:
   var2 := val2
return

ExitSub:
   cleanup
ExitApp

..


how do i install this?

follow the directions in the original post or just download the portable zip

Maestr0
  • Members
  • 652 posts
  • Last active: Aug 17 2019 06:07 PM
  • Joined: 18 Oct 2008
cool trick, this also works:
MyFoldingLabel: ;+

      put whatever you want

   return/Exit/ExitApp ;-


guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
do you guys even use folding ?

i suppose so given that we are discussing it. i find myself just using TillaGoTo or simply Ctrl+F to find my way through the file.

Maestr0
  • Members
  • 652 posts
  • Last active: Aug 17 2019 06:07 PM
  • Joined: 18 Oct 2008

do you guys even use folding ?

i suppose so given that we are discussing it. i find myself just using TillaGoTo or simply Ctrl+F to find my way through the file.

I haven't used it, but if it were possible, I'd use it more often. Right now, I used Ctrl-F if I know (part of) the label name or Ctrl-G if I know the row (based on my debugger).

geokoder
  • Members
  • 14 posts
  • Last active: Jul 27 2012 12:21 AM
  • Joined: 27 Jul 2012
404 on the download links :(

Any mirrors?

geokoder
  • Members
  • 14 posts
  • Last active: Jul 27 2012 12:21 AM
  • Joined: 27 Jul 2012
Bump for mirror.