Hi all,
New to Geany (and programming).
I would very much like to have escape sequences highlighted in a similar way to gedit. I've searched high and low for an explanation on how to achieve this and have come up empty. I'm sure it's very simple, however it's a mystery to me! I have attached a screenshot to visually explain what I mean.
Also, I realise I'm not using the default color scheme. I have tested with the default color scheme and still don't have the highlighting I seek.
Unsure if it's pertinent but am using 0.20.
Many thanks,
Damon McMinn
On 13 February 2012 07:46, Damon McMinn damonrmcminn@gmail.com wrote:
Hi all,
New to Geany (and programming).
I would very much like to have escape sequences highlighted in a similar way to gedit. I've searched high and low for an explanation on how to achieve this and have come up empty. I'm sure it's very simple, however it's a mystery to me! I have attached a screenshot to visually explain what I mean.
The reason you can't find how to do it is that it isn't possible. Scintilla (www.scintilla.org) is the editing component that does the lexing for the highlighting, and it doesn't separate escapes from strings.
To do it you would have to change the C++ code of the lexer in Scintilla
Cheers Lex
Also, I realise I'm not using the default color scheme. I have tested with the default color scheme and still don't have the highlighting I seek.
Unsure if it's pertinent but am using 0.20.
Many thanks,
Damon McMinn
Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Cheers Lex, that answers my question perfectly.
For what reason would Scintilla not separate escapes from strings? It seems like a useful feature.
d
On 12 February 2012 21:00, Lex Trotman elextr@gmail.com wrote:
On 13 February 2012 07:46, Damon McMinn damonrmcminn@gmail.com wrote:
Hi all,
New to Geany (and programming).
I would very much like to have escape sequences highlighted in a similar
way
to gedit. I've searched high and low for an explanation on how to achieve this and have come up empty. I'm sure it's very simple, however it's a mystery to me! I have attached a screenshot to visually explain what I
mean.
The reason you can't find how to do it is that it isn't possible. Scintilla (www.scintilla.org) is the editing component that does the lexing for the highlighting, and it doesn't separate escapes from strings.
To do it you would have to change the C++ code of the lexer in Scintilla
Cheers Lex
Also, I realise I'm not using the default color scheme. I have tested
with
the default color scheme and still don't have the highlighting I seek.
Unsure if it's pertinent but am using 0.20.
Many thanks,
Damon McMinn
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
On 13 February 2012 08:11, Damon McMinn damonrmcminn@gmail.com wrote:
Cheers Lex, that answers my question perfectly.
For what reason would Scintilla not separate escapes from strings? It seems like a useful feature.
You will have to ask them.
Cheers Lex
On 02/12/2012 12:46 PM, Damon McMinn wrote:
Hi all,
New to Geany (and programming).
I would very much like to have escape sequences highlighted in a similar way to gedit. I've searched high and low for an explanation on how to achieve this and have come up empty. I'm sure it's very simple, however it's a mystery to me! I have attached a screenshot to visually explain what I mean.
Hi,
I had some code I was using to highlight colours in the text but it's quite general so I adapted it to highlight escape sequences for you, it's here if you want it:
https://gist.github.com/1815807
See the Plugin Howto for information on how to compile it.
Cheers, Matthew Brush
On 13 February 2012 21:33, Matthew Brush mbrush@codebrainz.ca wrote:
On 02/12/2012 12:46 PM, Damon McMinn wrote:
Hi all,
New to Geany (and programming).
I would very much like to have escape sequences highlighted in a similar way to gedit. I've searched high and low for an explanation on how to achieve this and have come up empty. I'm sure it's very simple, however it's a mystery to me! I have attached a screenshot to visually explain what I mean.
Hi,
I had some code I was using to highlight colours in the text but it's quite general so I adapted it to highlight escape sequences for you, it's here if you want it:
https://gist.github.com/1815807
See the Plugin Howto for information on how to compile it.
Cheers, Matthew Brush
Hi Matthew,
Couple of questions to check I'm reading it right
1. isn't copying the entire buffer (sci_get_contents copies the whole file into a malloced buffer) on each change a bit heavy if the file is not tiny 2. you are changing indicators (calling scan_extra_items) in a SCN_MODIFIED notification, but scintilla explicitly states "No modifications may be performed while in a SCN_MODIFIED event"
Cheers Lex
Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On 02/13/2012 03:16 AM, Lex Trotman wrote:
On 13 February 2012 21:33, Matthew Brushmbrush@codebrainz.ca wrote:
On 02/12/2012 12:46 PM, Damon McMinn wrote:
Hi all,
New to Geany (and programming).
I would very much like to have escape sequences highlighted in a similar way to gedit. I've searched high and low for an explanation on how to achieve this and have come up empty. I'm sure it's very simple, however it's a mystery to me! I have attached a screenshot to visually explain what I mean.
Hi,
I had some code I was using to highlight colours in the text but it's quite general so I adapted it to highlight escape sequences for you, it's here if you want it:
https://gist.github.com/1815807
See the Plugin Howto for information on how to compile it.
Cheers, Matthew Brush
Hi Matthew,
Couple of questions to check I'm reading it right
- isn't copying the entire buffer (sci_get_contents copies the whole
file into a malloced buffer) on each change a bit heavy if the file is not tiny
Kinda sorta. At one point I was use GETCHARACTERPOINTER but it seemed to mess with the regexp, so I made a copy.
- you are changing indicators (calling scan_extra_items) in a
SCN_MODIFIED notification, but scintilla explicitly states "No modifications may be performed while in a SCN_MODIFIED event"
It's lying? Maybe it means modification of the text and not the styling stuff?
Anyway, it works fine for my uses (with colour regexps).
Cheers, Matthew Brush