Jump to content

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

LexAHK: syntax highlighting for Scintilla (SciTE, others?)


  • Please log in to reply
65 replies to this topic
ahklover
  • Members
  • 4 posts
  • Last active: Sep 26 2006 12:17 AM
  • Joined: 16 Sep 2006
SH is Syntax Highlighting (as mentioned in my posting's subject).

BY THE WAY, Thanks to you, Chris, PhiLho, Rajat and other for creating AHK and contributing to the AHK community.

AHK has made mylife easier.

I guess SH is "syntax highlight"



PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
Oh sorry... :oops:
Since in-topic subjects are rarely set, I never look at them... :-)

As for the "SH" file of Notepad++, I am not sure how to use it. IIRC, Notepad++ accepts custom lexers, which is, I think, a primitive generic lexer. I don't know much more.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

horst
  • Guests
  • Last active:
  • Joined: --
The end of a multiline comment /* ... */ is not recognized
Notepad++ just interpretes the rest of the file as comment

Has anyone a fix for this ?

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
New release:
2006-11-14

No changes on the lexer, but I updated the Scintilla version to the latest (1.71). I also improved the regular expression engine to support \d \D \s \S \w \W \xHH (HH = 2 hex digits) inside and outside char classes [...]. Beware for this one: I tested it, but I might have missed a bug. Not yet official.
I also renamed the source from LexAHK.cxx to LexAHK1.cxx (I will rename also the lexer later), because I feel a LexAHK2.cxx will be necessary when the v.2 of AutoHotkey will be out!
ahk.properties is also updated with regex.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

Paulo not logged
  • Guests
  • Last active:
  • Joined: --
Hi, PhiLho
Thanks for your work.
I noticed that using your dll and "...AutoHotkey.exe /ErrorStdOut..." in ahk.properties scite is not marking nor jumping to
the "error" line(if any) when we double click the error line reported in Output control.
If you want to add this type of error handling, you just need to edit LexOthers.cxx.

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
I added support to jump to a function definition, label or hotkey/hotstring/key remapping. See List functions (+ labels + hotstuff) in an AutoHotkey script for more information.
Next step: click on a function call, hit a hotkey, jump to the definition!
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
New release:
2006-11-26

I renamed the lexer to ahk1 too, so now I renamed the properties file to ahk1.properties. This way, I am consistent all the way!
I also corrected some minor bugs in the regex engine.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

automaticman
  • Members
  • 658 posts
  • Last active: Nov 20 2012 06:10 PM
  • Joined: 27 Oct 2006
It seems that still there's no downloadable package available. :?
Meaning continuing without special .ahk editing tools. Thanks for your efforts.

This thread is another example for making "possibly easy things" more complicated. My point is:

1- some of you used your brains hardly and developed a nice, very useful tool for AHK.
2- now writing about these tools here in the forum
3- other AHK users read these postings
4- result for other AHK users after reading those postings: NIL. :roll:

So the question here is:
Should all the other AHK users do the same effort of those previous great thinkers and developers? If yes, that's the point what I meant above as making "possibly easy things" more complicated. Said in another way what is missing in all these great efforts is "packaging the result" which is easy to use for others.

n-l-i-d
  • Guests
  • Last active:
  • Joined: --
1 - Get yourself a Scintilla based editor
2 - Replace the original Scintilla.dll lexer with the one provided by PhiLho
3 - Add the ahk1.properties file provided to the editor's directory
4 - Adapt the settings (file) of your editor to make Scintilla recognize and use the ahk highlighting.

Done...

:wink:

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
I am sorry, but I don't understand what you mean...

What do you mean by "no downloadable package available"? I just checked the links and they are OK. In case they were too discrete (the lack of underlining and the fact that their default color doesn't stand out much out of the surrounding text make them hard to spot), I changed their style.

I don't know what makes you think of the point 4). Indeed, there was no massive switch to SciTE, but I didn't expected it. They are some users of my DLL, still. And frankly, I made it first for me, for the fun and challenge, and to have something better than the hijacked ASM lexer...

If by "packaging the result" you meant you want a SciTE ready to use for AHK, I won't do it. The steps to have the result aren't so hard, and a package would be always behind the latest SciTE version anyway.
You can get easily SciTE from SourceForge, you just have to drop my version of SciLexer.dll on top of it, add ahk1.properties to the other properties files and edit a file to change three lines. How hard is this?
Now much more than writing an AHK script, IMHO. (OK, perhaps my first post is too verbose and hides these facts in too much details...)
SciTE might not be the most intuitive editor when it comes to change its settings to your liking, but it is one of the most flexible. Its power comes with a (little) price: reading the doc.

Thanks for your interest.

[EDIT] While I was typing this, n-l-i-d answered in a similar way. Just a point: AFAIK, my SciLexer won't work or won't be taken in account by other Windows-based Scintilla-based text editor (ie. Notepad++ and Notepad2), only by SciTE.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

BoBo
  • Guests
  • Last active:
  • Joined: --
Thx for your advise, but - lets be honest, that might habe been an obvious/task for those who have discussed that topic (at a quite sophisticated level btw.) and are used to use Scintilla, but not for the standard 'consumer', those who would have the greatest benefit regarding the outcome of that discussion ('the lexer').

For a standard user it's a little like you prepare the finest soup ever, and once done, the fellow crowd has to starve in front of the stockpot, because you're not wlling to give'm a spoon. :roll:

That's what I've understand from what automaticman has mentioned.

Thx for listening. 8)

BoBo
  • Guests
  • Last active:
  • Joined: --
FYI. My statement is linked to n-l-i-d's previous/last statement.

n-l-i-d
  • Guests
  • Last active:
  • Joined: --
Ok, here a step by step instruction for SciTE:

HowToSciTE4AHK.zip (zip file containing html file + pictures)

:wink:

automaticman
  • Members
  • 658 posts
  • Last active: Nov 20 2012 06:10 PM
  • Joined: 27 Oct 2006
I wanted to use this with Notepad++ which doesn't seem to work there. If anyone found a full Notepad++ solution for AutoHotkey it would be nice to get the link there here.

Important are

- how to add own function lists to Notepad++
- how to add your own language definition syntax to Notepad++

bschultz66
  • Guests
  • Last active:
  • Joined: --

Ok, here a step by step instruction for SciTE:

HowToSciTE4AHK.zip (zip file containing html file + pictures)

:wink:

except for the location for downloading the files this is great. (I did skim this thread and found it)

I'm finally kicking the notepad habit.

Great work

Great edit tool for ahk -- text editor for AutoHotKey