AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

LexAHK: syntax highlighting for Scintilla (SciTE, others?)
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources
View previous topic :: View next topic  
Author Message
BoBo
Guest





PostPosted: Tue May 09, 2006 11:15 am    Post subject: Reply with quote

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. Very Happy

* a single executable
Back to top
BoBo
Guest





PostPosted: Tue May 09, 2006 11:27 am    Post subject: Reply with quote

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)

PostPosted: Tue May 09, 2006 11:54 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6084

PostPosted: Tue May 09, 2006 12:25 pm    Post subject: Reply with quote

Dear PhiLho, Smile

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? Shocked



Thanks!. Awaiting eagerly Very Happy

Regards, Smile
_________________
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Tue May 09, 2006 1:00 pm    Post subject: Reply with quote

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 Wink

(Scare free time or spare free time - that's the question! (Hamlet) Smile)
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 6084

PostPosted: Tue May 09, 2006 1:12 pm    Post subject: Reply with quote

BoBo wrote:
(Scare free time or spare free time - that's the question! (Hamlet) Smile)


I guess it should have been "Scarce free time" Smile

Regards, Smile
_________________
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Tue May 09, 2006 2:37 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6084

PostPosted: Tue May 09, 2006 2:54 pm    Post subject: Reply with quote

Dear PhiLho, Smile

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.


Sad Crying or Very sad Sad

As BoBo requested, maybe someday you should re-compile Notepad2 atleast.

Regards, Smile
_________________
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Wed May 10, 2006 11:57 am    Post subject: Update 1 Reply with quote

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
View user's profile Send private message Visit poster's website
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Wed May 10, 2006 12:52 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
BoBo
Guest





PostPosted: Wed May 10, 2006 12:56 pm    Post subject: Reply with quote

@ PhiLho
I'm fine with that and I really appreciate your effort to provide an AHK lexer. Thx mate. Very Happy
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 6084

PostPosted: Wed May 10, 2006 6:08 pm    Post subject: Reply with quote

PhiLho wrote:
For Notepad++, I wrote a message in their forum, asking for more flexibility or perhaps future AHK support.


I have sub-posted : http://sourceforge.net/forum/message.php?msg_id=3722727

Anybody else willing?

Regards, Smile
_________________
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2419

PostPosted: Thu May 11, 2006 1:54 am    Post subject: Reply with quote

@PhiLho: Nice work on the lexer Smile
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6084

PostPosted: Thu May 11, 2006 10:13 am    Post subject: Reply with quote

Dear PhiLho, Smile

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, Smile
_________________
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Thu May 11, 2006 1:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 2 of 7

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group