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
RaptorX
  • Members
  • 751 posts
  • Last active: Feb 19 2015 02:47 AM
  • Joined: 19 Feb 2010
That problem is not related to my lexer, I can perfectly create a var and append text to it and it wont affect the highlighting...

%var%(will highlight)
\text.txt (wont take off the highlighting)
so i can see this perfectly fine: %var%\text.txt

--edit
to make sure you ware indeed using my lexer and having troubles try this code:

; test
;{
; this should allow you to fold
;}

if that doesnt add the fold on the left side then you are not really using my lexer

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

That problem is not related to my lexer, I can perfectly create a var and append text to it and it wont affect the highlighting...

%var%(will highlight)
\text.txt (wont take off the highlighting)
so i can see this perfectly fine: %var%\text.txt

--edit
to make sure you ware indeed using my lexer and having troubles try this code:

; test
;{
; this should allow you to fold
;}

if that doesnt add the fold on the left side then you are not really using my lexer


sorry, I was unclear. I think it's not necessarily to do with your lexer, but more that it could have been to do with having to switch "languages" through the np++ menu, because it was using the old api to show them at first.

Maestr0
  • Members
  • 652 posts
  • Last active: Aug 17 2019 06:07 PM
  • Joined: 18 Oct 2008
couldn't get it to work with NPP 5.8 Unicode ... I get an error message:


---------------------------
Exception
---------------------------
Unknown exception
---------------------------
OK
---------------------------

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

couldn't get it to work with NPP 5.8 Unicode ... I get an error message:


---------------------------
Exception
---------------------------
Unknown exception
---------------------------
OK
---------------------------


are you sure that that is my lexer that causes that error?
if it is thank you for pointing out, since i compiled the lexer with an older version of N++.

I am using N++ 5.7 at the moment, you might want to try that one in the mean time while I see if i can update the lexer tonight or tomorrow.

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

are you sure that that is my lexer that causes that error?
if it is thank you for pointing out, since i compiled the lexer with an older version of N++.


yes, I doublechecked, it goes away after removing your files.
Not sure exactly which of your files are causing the problem, though.

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

if it is thank you for pointing out, since i compiled the lexer with an older version of N++.

I am using N++ 5.7 at the moment, you might want to try that one in the mean time while I see if i can update the lexer tonight or tomorrow.


any luck?

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
I am having the same issue. The lexer simply does not work under N++ 5.8.

JP
  • Guests
  • Last active:
  • Joined: --
I too am experiencing the same thing - the AHKextLexer does not work with version 5.8. Here is one thing I noticed that might help diagnose the problem. I renamed SciLexer.dll and put the previous version in. Then AHKextLexer worked just fine. So the problem seems to be related to the new version of SciLexer.dll

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
Thanks for the tip, JP! I've restored that file using Dropbox, and I now have the SH and folding back. However, it would be nice if there was a version compatible with the new SciLexer.dll.

RaptorX
  • Members
  • 751 posts
  • Last active: Feb 19 2015 02:47 AM
  • Joined: 19 Feb 2010
I am trying to compile with the new version but the problem is that they seem to have removed few files, and renamed others that were being used as #includes on my lexer, I have to contact the N++ developers to get an idea of how can i compile with the new version.

I am not sure how much is going to take but I am working on it. Will link to the forum post i made on N++ so you can check on the progress.

As soon as i am able to compile I will post back here

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

I am trying to compile with the new version but the problem is that they seem to have removed few files, and renamed others that were being used as #includes on my lexer, I have to contact the N++ developers to get an idea of how can i compile with the new version.

I am not sure how much is going to take but I am working on it. Will link to the forum post i made on N++ so you can check on the progress.

As soon as i am able to compile I will post back here


With 5.8.1 NPP will no longer crash, however, I have not been able to get the syntaxing to work either.

<!-- m -->http://notepad-plus-...g/release/5.8.1<!-- m -->

RaptorX
  • Members
  • 751 posts
  • Last active: Feb 19 2015 02:47 AM
  • Joined: 19 Feb 2010
I will need help on this one because it seems to be that the new scintilla (which is used for the lexer) has changed a bunch... that means that the lexer needs to be rewritten which I am not able to since I am not a C/C++ programmer.

one quick solution i will try (though not the correct one) is to replace the SciLexer.dll file located on the n++ directory (which is the one causing problems) with the old version of it, that way you guys can use N++ 5.8 with my lexer until I really fix the problem which Im afraid will take longer than i expected

--Edit
Tested it and it worked on 5.8, the problem is the new Scilexer.dll

Workaround: Get this file and replace the existing one inside the N++ 5.8 folder.
If you dont want to use this file just go to notepad++ and download the 5.7 version and get the SciLexer.dll file and replace the 5.8 version with it.

Until I rewrite the lexer this is the only work around i know.

--Edit 2
There are no noticeable drawbacks, if you find one (like another lexer not working because of the swap) please notify so i can update the post.

OpalMonkey
  • Members
  • 29 posts
  • Last active: Aug 07 2015 08:21 AM
  • Joined: 26 Sep 2009
Thanks for the workaround. I was horror-stricken when I opened up a script yesterday and there was nothing but plain text!

It would be nice if a C/C++ programmer took an interest in this lexer. I'm actually surprised no one with that skill set has, considering the popularity of both Notepad++ and AHK.

Anyways, thanks again for the workaround. And, of course, the wonderful lexer RaptorX! Maybe it'll come back updated and better than ever?

semi225599
  • Members
  • 269 posts
  • Last active: Dec 27 2011 09:23 PM
  • Joined: 12 Jun 2010
Since, this is going to be rewritten, could you add syntax highlighting for AutoHotkey_L? (#If, Until, etc)
I'm sure you saw the announcement that Chris is moving on, and since AutoHotkey_L is going to be the maintained version now, it seems like the syntax highlighting should support all of the new commands/directives.

ruespe
  • Members
  • 567 posts
  • Last active: Dec 01 2014 07:59 PM
  • Joined: 17 Jun 2008
NPP FunctionList
For everybody, who uses the FunctionList of NPP, here is the XML-Code that makes FunctionList compatible with Raptor's lexer
<Language name="AutoHotkey" imagelistpath="">
        <CommList param1="^[ \t]*/\*" param2="\*/[ \t]*$" />
        <Group name="FUNCTION" subgroup="" icon="0" child="0" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^" regexfunc="[[email protected]?#\[\]_]+" regexend="\([^(]*\)" bodybegin="{" bodyend="}" sep="$" />
        </Group>
        <Group name="SUB" subgroup="" icon="0" child="0" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^" regexfunc="[[email protected]?#\[\]_'-]+[:]" regexend="[ \t]*$" bodybegin="" bodyend="^[r]eturn[ \t]*$" sep="$" />
            <Rules regexbeg="^" regexfunc="[[email protected]?#\[\]_'-]+[:]" regexend="[ \t]*[;].*$" bodybegin="" bodyend="^[r]eturn[ \t]*$" sep="" />
        </Group>
        <Group name="HOTKEYS" subgroup="" icon="0" child="0" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^" regexfunc="[#!^+&*~$ -=\[\]\\;',./A-Za-z0-9]+[:][:]" regexend="" bodybegin="" bodyend="" sep="" />
            <Rules regexbeg="^" regexfunc="[^;][#!^+&*~$ -=\[\]\\;',./A-Za-z0-9]+[:][:][ \t]*[;].*$" regexend="" bodybegin="" bodyend="^[r]eturn[ \t]*$" sep="$" />
        </Group>
        <Group name="INCLUDE" subgroup="" icon="0" child="0" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^" regexfunc="#include[ \t]+[a-zA-Z0-9~\-_.:\\]+" regexend="" bodybegin="" bodyend="$" sep="" />
        </Group>
        <Group name="#IF" subgroup="" icon="0" child="0" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^" regexfunc='#if[ \t]*[a-zA-ZäöüßÄÖÜ0-9(")_ \-\#,.:\\]*' regexend="" bodybegin="" bodyend="" sep="" />
        </Group>
    </Language>
Insert these lines directly behind the first line
<FunctionList>
of Notepad++\plugins\Config\FunctionListRules.xml. And don't forget to backup :!: