 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
BoBo Guest
|
Posted: Tue May 09, 2006 11:15 am Post subject: |
|
|
PhilHo wrote: | Quote: | | Perhaps using a Notepad2 base: small*, a bit rustic (tried it only briefly!) although friendlier than SciTE, open source, so not too hard to adapt | Exactly what I've wanted to point out. Thx for your confirmation.
* a single executable |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Tue May 09, 2006 11:27 am Post subject: |
|
|
In case someone is able to deal with implementing PhilHo's lexer: | Quote: | Could you please explain how to add or modify syntax schemes?
This requires modification of the Notepad2 source code.
The Scintilla documentation has an overview of syntax highlighting, and how to write your own lexer, in case the language you'd like to add is not supported by Scintilla.
The structures relevant to syntax highlighting can be found in Styles.c of the Notepad2 source code. Add your own structures to the global pLexArray, then adjust NUMLEXERS to the total number of syntax schemes. The style definitions can be found in SciLexer.h of the Scintilla source code.
Include the Lex*.cxx files from Scintilla required for your languages in your project and follow the instructions in Readme.txt to rebuild Notepad2. I recommend using Visual Studio .NET 7 or above.
[Notepad2 1.0.12 Source Code] |
|
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Tue May 09, 2006 11:54 am Post subject: |
|
|
| Goyyah wrote: | It will be very helpful to the community if you can
- Recompile Notepad++ to automatically support AHK Syntax Highlighting
- Provide a download in .ZIP format ( requiring no installation )
- .REG files to associate Notepad++ to be the default editor for AHK
| Notepad++ uses regular SciLexer.dll, so replacing the provided one with mine and replacing two XML files should do the trick (once I finished doing that). No need for recompiling it. That's Notepad2 which needs recompiling. And I won't do it, I prefer to spend my scarce free time to improve the lexer (and do other projects).
[EDIT] My bad, both need recompiling, see below! _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Last edited by PhiLho on Tue May 09, 2006 2:10 pm; edited 1 time in total |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Tue May 09, 2006 12:25 pm Post subject: |
|
|
Dear PhiLho,
| You wrote: | | Notepad++ uses regular SciLexer.dll, so replacing the provided one with mine and replacing two XML files should do the trick (once I finished doing that). No need for recompiling it. |
And will that add AHK to the Languages Menu?
Thanks!. Awaiting eagerly
Regards,  _________________
 |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Tue May 09, 2006 1:00 pm Post subject: |
|
|
| Quote: | | That's Notepad2 which needs recompiling. And I won't do it, I prefer to spend my scare free time to improve the lexer (and do other projects). | Fair enough
(Scare free time or spare free time - that's the question! (Hamlet) ) |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Tue May 09, 2006 1:12 pm Post subject: |
|
|
| BoBo wrote: | (Scare free time or spare free time - that's the question! (Hamlet) ) |
I guess it should have been "Scarce free time"
Regards,  _________________
 |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Tue May 09, 2006 2:37 pm Post subject: |
|
|
Ehe, a c has been lost, indeed!
I made a sad discovery, Goyyah was right, Notepad++ needs to be recompiled too.
While the stylers.xml and langs.xml files looked like the program was flexible, looking in the sources to see why I didn't saw AutoHotkey in the language menu (as shown by Goyyah), I saw that author, for some reason, hard-coded the language lists in several places!
I don't understand this choice that forbid using less common languages already supported by Scintilla. Being more flexible wouldn't cost probably much. Of course, replacing its SciLexer.dll by a standard or customized one might break some features (perhaps the line draw mode, perhaps the user defined one) and would bloat it (since this is a subset of languages, it is smaller than standard one). But I am still disappointed.
Well, perhaps you can petition the author:
1) To be more flexible;
2) (more likely) To support AHK.
I still have the above XML files, in case they become useful someday. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Tue May 09, 2006 2:54 pm Post subject: |
|
|
Dear PhiLho,
| You wrote: | Well, perhaps you can petition the author:
1) To be more flexible;
2) (more likely) To support AHK.
I still have the above XML files, in case they become useful someday. |
As BoBo requested, maybe someday you should re-compile Notepad2 atleast.
Regards,  _________________
 |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed May 10, 2006 11:57 am Post subject: Update 1 |
|
|
First update, see first post to see what is changed: various bug fixes, functionnal folding. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed May 10, 2006 12:52 pm Post subject: |
|
|
| Goyyah wrote: | | As BoBo requested, maybe someday you should re-compile Notepad2 atleast. | Not me, sorry.
I downloaded the source of Notepad2, out of curiosity, and I saw it is even worse (read: less flexible) than Notepad++, in the sense that keywords and styles are hard-coded in the source code, so it seems very hard to alter them (style are overridable, but I saw no way to add or change keywords).
Again, I won't do it, but it shouldn't be such a hard task to upgrade these editors.
For Notepad++, I wrote a message in their forum, asking for more flexibility or perhaps future AHK support. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Wed May 10, 2006 12:56 pm Post subject: |
|
|
@ PhiLho
I'm fine with that and I really appreciate your effort to provide an AHK lexer. Thx mate.  |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2419
|
Posted: Thu May 11, 2006 1:54 am Post subject: |
|
|
@PhiLho: Nice work on the lexer  |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Thu May 11, 2006 10:13 am Post subject: |
|
|
Dear PhiLho,
| You wrote: | In your post
Well, perhaps you can petition the author:
1) To be more flexible;
2) (more likely) To support AHK.
I still have the above XML files, in case they become useful someday |
I do not how but AHK shows in the bottom of the "Languages Menu"
Can I have a copy of those XML Files.. Please!
Regards,  _________________
 |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Thu May 11, 2006 1:30 pm Post subject: |
|
|
They are stylers.xml and langs.xml, with only the AHK definitions, ie. they have to be merged in the existing files.
But I think you only created a User Defined language, and you already have the corresponding syntax files in %A_AhkPath%\Extras\Editors\Notepad++\ _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|