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
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Sun May 13, 2007 12:08 pm    Post subject: Reply with quote

Thanks for the clarification. I understood from Skans post that it is possible. I was wrong. Thanks, that saved me some hours testing. Is there a multitab editor that can be used with your lexer?
I'll take a look at Scintilla. Does it have multitabs?
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Sun May 13, 2007 10:32 pm    Post subject: Reply with quote

A small improvement to the ahk1.properties file:
Code:
# Command to run script (F5)
command.go.$(file.patterns.ahk)="$(autohotkeydir)\AutoHotkey.exe" /ErrorStdOut "$(FileNameExt)"
This will show the error messages in the SciTE window and not as an popup message window.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Sun May 13, 2007 10:42 pm    Post subject: Reply with quote

Your screenshot looks much more colorful then the SciTE window I have in front of me. Do I have to edit the ahk1.properties file to change it? How should I do it? I also noticed that your code folding symbols look differently then the one I see. Maybe because I use version 1.73.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
PhiLho



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

PostPosted: Mon May 14, 2007 9:12 am    Post subject: Reply with quote

OK, that's three messages to answer... Smile

Quote:
"multitab editor that can be used with your lexer"
You found it, it is called SciTE, not Scintilla, which is the main component used by SciTE (Scintilla Text Editor, initially just a demo of Scintilla, now much more).

Quote:
/ErrorStdOut
Good idea, I will add to the file to download. Alas the error format isn't recognized by the error line lexer (in LexOthers.cxx). Looking at the searched format, I found a simple workaround: just add a space before the colon after the line number, and SciTE will take it as a Microsoft error, so double-clicking on the line will open the file and go to the line with error.

Quote:
Do I have to edit the ahk1.properties file to change it?
No, perhaps you forgot to add the import ahk1 to the SciTEUser.properties file.
Or the standard colors probably differs from mine, which I tweak from time to time:
Code:
colour.code.comment.box=fore:#7070A0
colour.code.comment.line=fore:#8080A0
colour.code.comment.doc=fore:#0000A0
colour.text.comment=fore:#0000FF,back:#D0F0D0
colour.other.comment=fore:#007F7F
colour.embedded.comment=back:#E0EEFF
colour.notused=back:#FF0000

colour.number=fore:#D000FF
colour.keyword=fore:#0055AA
colour.string=fore:#8000FF
colour.char=fore:#008040
colour.operator=fore:#C07040
colour.preproc=fore:#A00070
colour.error=fore:#FFFF00,back:#FF0000
Rendering can also change with the monitor, the view angle, and so on.

Quote:
I also noticed that your code folding symbols look differently then the one I see.
I use fold.symbols=2
_________________
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
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Mon May 14, 2007 10:50 am    Post subject: Reply with quote

thanks a lot.
I'm currently wading through the SciTE documentation. Please see also my post in the ask for help section on how to direct SciTE from within AHK.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Wed May 23, 2007 3:35 pm    Post subject: Reply with quote

PhiLho wrote:
Quote:
/ErrorStdOut
Good idea, I will add to the file to download. Alas the error format isn't recognized by the error line lexer (in LexOthers.cxx). Looking at the searched format, I found a simple workaround: just add a space before the colon after the line number, and SciTE will take it as a Microsoft error, so double-clicking on the line will open the file and go to the line with error.
Dear PhiLho, could you please tell me what different formats the error line lexer can read?

I'm planing to inject some lines into the output pane. These lines represent the certain lines of code in the file with their line numbers. I wantto give the user the ability to jump to these lines by just clicking in the output pane. But it is too difficultto guess the correct format, so that the error lexer understands them.

Thanks a lot.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
PhiLho



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

PostPosted: Wed May 23, 2007 4:12 pm    Post subject: Reply with quote

Raw from the LexOthers.cxx source code:
Code:
      // Look for one of the following formats:
      // GCC: <filename>:<line>:<message>
      // Microsoft: <filename>(<line>) :<message>
      // Common: <filename>(<line>): warning|error|note|remark|catastrophic|fatal
      // Common: <filename>(<line>) warning|error|note|remark|catastrophic|fatal
      // Microsoft: <filename>(<line>,<column>)<message>
      // CTags: \t<message>
      // Lua 5 traceback: \t<filename>:<line>:<message>
Plus some other formats with textual content, for example:
Code:
File "Foo", line 555 (Python)
Error xxx in Foo on line 555 (PHP)
line 840 column 1 (HTML Tidy)
In red, the relevant strings. If they are at start of line, they must remain this way. You can test just by typing a string in the Output pane.
_________________
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
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Wed May 23, 2007 4:24 pm    Post subject: Reply with quote

Thanks a lot for the quick reply.

The
Code:
line 220 column 1 (HTML Tidy)
is close to what I need. Since all the lines are in the same file, I do not want to put the filename into every line. Unfortunately it doesn't work without the "column \d+". PSPad just uses
Code:
<filename>
<line>: <message>
which is very elegant, since it is good to read. If there are things in multiple files on multiple lines. it is
Code:
<filename>
<line>: <message>
<line>: <message>
<line>: <message>
<filename>
<line>: <message>
<line>: <message>
<line>: <message>
Is this possible in SciTE too?
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
PhiLho



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

PostPosted: Wed May 23, 2007 5:07 pm    Post subject: Reply with quote

Something close to your needs, then, is the GCC format:
filename:1400:error message
Note that the filename can be anything, if not found, SciTE just use the current buffer and jumps to the given line.
For example, .:1400: error just works.
_________________
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
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Wed May 23, 2007 5:47 pm    Post subject: Reply with quote

Code:
line <line> column <column> <message>

has the advantage of highlighting the text from column to the end of line. But thanks for your insight. I made notes. For the time being I stick with the above.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mosaic



Joined: 25 Apr 2007
Posts: 20

PostPosted: Thu Jun 07, 2007 2:04 pm    Post subject: Reply with quote

Greetings PhiLho/Toralf and others,

I did not realize there is another topic on Notepad++ here. While I like the syntax highlighting, the function list plugin is way more powerful, it allows one to browse the code efficiently.

The following is the screen shot, you can see the function list on the right side panel. What's useful is not simply the list of functions (notice I have customized it to recognize the include directive as well, by the way, in Notepad++, one can highlight the included filename, hit a hotkey Alt+F5 to open that file???), one can also double click on the function name, it will automatically go to the begining of the function (subroutine) definition:



In terms of Syntax Highlighting/Folding feature, I would like to see the provision of Subroutine folding, currently, the UserDefineLang.xml can do the folding for function fairly well, but not for subroutines.

In the above screenshot, you can notice that in the bottom, I made a dock window (based on majk..'s dock), which displayed some file info, there are also four text button on the right bottom: R/W, Load, 2Dir, Explorer, these are quick buttons to toggle the read/write attribute of the edited file, Load the script if it is AHK script, Goto the command window of the directory where the edited file resides, Explorer the directory where the edited file resides. Quite handy for myself.

Let me know PhiLho when you are ready to make improvement on your lexer, I am willing to test it. Toralf, I realized that you are ready to try Notepad++, have you tried it yet?
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Tue Jun 12, 2007 1:23 pm    Post subject: Reply with quote

Dear mosaic,
I think I will use SciTE, when the lexer is done. It has most of the features I need.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
4sdf
Guest





PostPosted: Sat Oct 06, 2007 1:42 pm    Post subject: Sc1 <-- Reply with quote

is it possible to decompile sc1 replace SciTEGlobal.properties and edit the lexer to add ahk support, then compile it back again with Philhos SH and my personal prefs?

i want the other SH's in thats default in Sc1
Back to top
PhiLho



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

PostPosted: Mon Nov 05, 2007 5:04 pm    Post subject: Reply with quote

No need to decompile...
The source distribution should provide everything needed to compile Sc1 from scratch.
_________________
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
4sdf
Guest





PostPosted: Sun Nov 25, 2007 12:04 am    Post subject: Reply with quote

ok i guess i could try rtfm, it seems hard. does it start from what sc1.exe is configured to or do i need to read about every single setting to set it up?

I like the sc1 that is already compiled but would like to change/add a couple of things.
Back to top
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 6 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