Hi,
when compiling/building something from Geany, the output is printed in a nice highlighted format into the Compiler window in the bottom of the screen. However, if the output is long, it is useful to copy the output to a new window of the editor, but then I loose the highlighting. Is the highlighting mode of the compiler documented somewhere so it can be easily transformed into a custom filetype?
Regards,
Robert
On 29 August 2012 18:57, Robert Fekete fekete77.robert@gmail.com wrote:
Hi,
when compiling/building something from Geany, the output is printed in a nice highlighted format into the Compiler window in the bottom of the screen. However, if the output is long, it is useful to copy the output to a new window of the editor, but then I loose the highlighting. Is the highlighting mode of the compiler documented somewhere so it can be easily transformed into a custom filetype?
Hi,
Unfortunately the answer to that is pretty much no.
The highlighting in the edit window is provided by the Scintilla editing components lexers. There is not a lexer for decoding and highlighting compiler errors. And because the edit window determines its highlighting this way, it will ignore any style information that might be passed from the Compiler window (though I doubt that any styling is copied anyway)
The compiler highlighting is simply regex based to decide the style of each line and extract the source file line number. The window is a GTK tree, it is not a Scintilla window.
But since the highlighting is just line and regex based you might be able to create a scintilla lexer reasonably easily if you copy some of the existing regex based ones, but it is still C++ coding.
Cheers Lex
Regards,
Robert _______________________________________________ Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On Wed, Aug 29, 2012 at 5:17 AM, Lex Trotman elextr@gmail.com wrote:
The highlighting in the edit window is provided by the Scintilla editing components lexers. There is not a lexer for decoding and highlighting compiler errors.
Are you sure? I use SciTE, and its output pane does have highlighting done by Scintilla. I have done practically no Geany configuration, so I don't know how you would "port" these settings (and in fact there may be some things that are SciTE-specific, and thus not portable to Geany), but what SciTE has in its others.properties file is
*** begin excerpts ***
lexer.*.err=errorlist
# Error list styles
style.errorlist.32=fore:#B06000,$(font.small) # Default style.errorlist.0=fore:#000000 # python Error style.errorlist.1=fore:#FF0000 # gcc Error style.errorlist.2=fore:#800080 # Microsoft Error style.errorlist.3=fore:#808000 # command or return status style.errorlist.4=fore:#0000FF # Borland error and warning messages style.errorlist.5=fore:#B06000 # perl error and warning messages style.errorlist.6=fore:#FF0000 # .NET tracebacks style.errorlist.7=fore:#FF0000 # Lua error and warning messages style.errorlist.8=fore:#FF0000 # ctags style.errorlist.9=fore:#FF00FF # diff changed ! style.errorlist.10=fore:#007F00 # diff addition + style.errorlist.11=fore:#00007F # diff deletion - style.errorlist.12=fore:#007F7F # diff message --- style.errorlist.13=fore:#7F0000 # PHP error style.errorlist.14=fore:#FF0000 # Essential Lahey Fortran 90 error style.errorlist.15=fore:#FF0000 # Intel Fortran Compiler error style.errorlist.16=fore:#FF0000 # Intel Fortran Compiler v8.0 error/warning style.errorlist.17=fore:#FF0000 # Absoft Pro Fortran 90/95 v8.2 error or warning style.errorlist.18=fore:#FF0000 # HTML Tidy style.errorlist.19=fore:#FF0000 # Java runtime stack trace style.errorlist.20=fore:#FF0000 # Text matched with find in files and message part of GCC errors style.errorlist.21=fore:#000000 # Ensures that spacing is not affected by line number styles style.errorlist.33=$(font.small)
lexer.errorlist.value.separate=1
*** end excerpts ***
So I'd bet there is some way you can leverage Scintilla to do this in Geany.
Cheers, John
On 29 August 2012 20:51, John Yeung gallium.arsenide@gmail.com wrote:
On Wed, Aug 29, 2012 at 5:17 AM, Lex Trotman elextr@gmail.com wrote:
The highlighting in the edit window is provided by the Scintilla editing components lexers. There is not a lexer for decoding and highlighting compiler errors.
Are you sure? I use SciTE, and its output pane does have highlighting done by Scintilla. I have done practically no Geany configuration, so I don't know how you would "port" these settings (and in fact there may be some things that are SciTE-specific, and thus not portable to Geany), but what SciTE has in its others.properties file is
*** begin excerpts ***
lexer.*.err=errorlist
# Error list styles
style.errorlist.32=fore:#B06000,$(font.small) # Default style.errorlist.0=fore:#000000 # python Error style.errorlist.1=fore:#FF0000 # gcc Error style.errorlist.2=fore:#800080 # Microsoft Error style.errorlist.3=fore:#808000 # command or return status style.errorlist.4=fore:#0000FF # Borland error and warning messages style.errorlist.5=fore:#B06000 # perl error and warning messages style.errorlist.6=fore:#FF0000 # .NET tracebacks style.errorlist.7=fore:#FF0000 # Lua error and warning messages style.errorlist.8=fore:#FF0000 # ctags style.errorlist.9=fore:#FF00FF # diff changed ! style.errorlist.10=fore:#007F00 # diff addition + style.errorlist.11=fore:#00007F # diff deletion - style.errorlist.12=fore:#007F7F # diff message --- style.errorlist.13=fore:#7F0000 # PHP error style.errorlist.14=fore:#FF0000 # Essential Lahey Fortran 90 error style.errorlist.15=fore:#FF0000 # Intel Fortran Compiler error style.errorlist.16=fore:#FF0000 # Intel Fortran Compiler v8.0 error/warning style.errorlist.17=fore:#FF0000 # Absoft Pro Fortran 90/95 v8.2 error or warning style.errorlist.18=fore:#FF0000 # HTML Tidy style.errorlist.19=fore:#FF0000 # Java runtime stack trace style.errorlist.20=fore:#FF0000 # Text matched with find in files and message part of GCC errors style.errorlist.21=fore:#000000 # Ensures that spacing is not affected by line number styles style.errorlist.33=$(font.small)
lexer.errorlist.value.separate=1
*** end excerpts ***
So I'd bet there is some way you can leverage Scintilla to do this in Geany.
Ok, its hidden away in LexOthers.cxx, so as there is a lexer in Scintilla and its actually in Geany, but it doesn't have the highlighting mapping or a filetype for it, you would need to create those (see HACKING).
One potential problem is that Geany error message recognition is different (and user settable), so you might not get the same messages being recognised but it would probably be ok for the most common compilers.
We don't use a scintilla window because we have the click on a red error message and go to the line in the file capability as well as the above mentioned user settable recognition.
Cheers Lex
Cheers, John _______________________________________________ Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Thanks a lot for the pointers, I'll see if I can come up with something.
Robert
On Wed, Aug 29, 2012 at 1:37 PM, Lex Trotman elextr@gmail.com wrote:
On 29 August 2012 20:51, John Yeung gallium.arsenide@gmail.com wrote:
On Wed, Aug 29, 2012 at 5:17 AM, Lex Trotman elextr@gmail.com wrote:
The highlighting in the edit window is provided by the Scintilla editing components lexers. There is not a lexer for decoding and highlighting compiler errors.
Are you sure? I use SciTE, and its output pane does have highlighting done by Scintilla. I have done practically no Geany configuration, so I don't know how you would "port" these settings (and in fact there may be some things that are SciTE-specific, and thus not portable to Geany), but what SciTE has in its others.properties file is
*** begin excerpts ***
lexer.*.err=errorlist
# Error list styles
style.errorlist.32=fore:#B06000,$(font.small) # Default style.errorlist.0=fore:#000000 # python Error style.errorlist.1=fore:#FF0000 # gcc Error style.errorlist.2=fore:#800080 # Microsoft Error style.errorlist.3=fore:#808000 # command or return status style.errorlist.4=fore:#0000FF # Borland error and warning messages style.errorlist.5=fore:#B06000 # perl error and warning messages style.errorlist.6=fore:#FF0000 # .NET tracebacks style.errorlist.7=fore:#FF0000 # Lua error and warning messages style.errorlist.8=fore:#FF0000 # ctags style.errorlist.9=fore:#FF00FF # diff changed ! style.errorlist.10=fore:#007F00 # diff addition + style.errorlist.11=fore:#00007F # diff deletion - style.errorlist.12=fore:#007F7F # diff message --- style.errorlist.13=fore:#7F0000 # PHP error style.errorlist.14=fore:#FF0000 # Essential Lahey Fortran 90 error style.errorlist.15=fore:#FF0000 # Intel Fortran Compiler error style.errorlist.16=fore:#FF0000 # Intel Fortran Compiler v8.0 error/warning style.errorlist.17=fore:#FF0000 # Absoft Pro Fortran 90/95 v8.2 error or warning style.errorlist.18=fore:#FF0000 # HTML Tidy style.errorlist.19=fore:#FF0000 # Java runtime stack trace style.errorlist.20=fore:#FF0000 # Text matched with find in files and message part of GCC errors style.errorlist.21=fore:#000000 # Ensures that spacing is not affected by line number styles style.errorlist.33=$(font.small)
lexer.errorlist.value.separate=1
*** end excerpts ***
So I'd bet there is some way you can leverage Scintilla to do this in Geany.
Ok, its hidden away in LexOthers.cxx, so as there is a lexer in Scintilla and its actually in Geany, but it doesn't have the highlighting mapping or a filetype for it, you would need to create those (see HACKING).
One potential problem is that Geany error message recognition is different (and user settable), so you might not get the same messages being recognised but it would probably be ok for the most common compilers.
We don't use a scintilla window because we have the click on a red error message and go to the line in the file capability as well as the above mentioned user settable recognition.
Cheers Lex
Cheers, John _______________________________________________ Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany