I'm a new Geany user. First, thanks all developers for your hard work on a great program. The editor is amazing!
My question is about what Geany automatically does when a single quote character (') is placed in front of a word and if its possible to control that behavior. I ask because one language I'm currently developing in is Maxima and the single quote is an operator (prevents evaluation).
For my colorscheme=zenburn.conf and lexer_filetype=C, when I type a single quote before a word, it italicizes the rest of the current line, and changes all colors to a light red (overwriting any colors per primary and secondary keywords I have defined in my filetypes.Maxima.conf)
Are there any settings / knobs I can turn to modify this behavior, such as lexer_properties or settings, in the filetypes.*.conf file? Preferably, I'd like to avoid writing my own lexer file to make this small change; but if its necessary, I'd appreciate some advice on how and where to make that change in the src.
Thanks!
Ethan
On 10 February 2018 at 14:45, Ethan Beyak ethanbeyak@gmail.com wrote:
I'm a new Geany user. First, thanks all developers for your hard work on a great program. The editor is amazing!
My question is about what Geany automatically does when a single quote character (') is placed in front of a word and if its possible to control that behavior. I ask because one language I'm currently developing in is Maxima and the single quote is an operator (prevents evaluation).
For my colorscheme=zenburn.conf and lexer_filetype=C, when I type a single quote before a word, it italicizes the rest of the current line, and changes all colors to a light red (overwriting any colors per primary and secondary keywords I have defined in my filetypes.Maxima.conf)
Are there any settings / knobs I can turn to modify this behavior, such as lexer_properties or settings, in the filetypes.*.conf file? Preferably, I'd like to avoid writing my own lexer file to make this small change; but if its necessary, I'd appreciate some advice on how and where to make that change in the src.
Syntax highlighting is controlled by a lexer written in C++ that identifies syntactic elements. You have selected to use the C language lexer where single quotes identify character literals.
You should try other languages, but most use single quote as a character sequence opening. Perhaps Lisp would be more useful since single quote has a similar meaning in Lisp to Maxima (and come to think of it I believe Maxima is written in Lisp)..
You could create a colour scheme that sets the styling for characters to something neutral, but nothing in the rest of the line (or at least to the next single quote, that being what C requires to close a character) will be syntactically analysed since the lexer thinks its a character literal.
For anything else you would have to change the lexer to stop it identifying characters when it encounters a single quote. The lexer is part of the Scintilla editing widget Geany uses and is in the scintilla directory.
Cheers Lex
Thanks!
Ethan
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
On 2018-02-09 08:45 PM, Ethan Beyak wrote:
I'm a new Geany user. First, thanks all developers for your hard work on a great program. The editor is amazing!
My question is about what Geany automatically does when a single quote character (') is placed in front of a word and if its possible to control that behavior. I ask because one language I'm currently developing in is Maxima and the single quote is an operator (prevents evaluation).
For my colorscheme=zenburn.conf and lexer_filetype=C, when I type a single quote before a word, it italicizes the rest of the current line, and changes all colors to a light red (overwriting any colors per primary and secondary keywords I have defined in my filetypes.Maxima.conf)
Are there any settings / knobs I can turn to modify this behavior, such as lexer_properties or settings, in the filetypes.*.conf file? Preferably, I'd like to avoid writing my own lexer file to make this small change; but if its necessary, I'd appreciate some advice on how and where to make that change in the src.
Hi,
You don't really say what change you want to make, but I think the style you're seeing is from an unterminated string highlighting[0]. You can at least change the colour/variant there, but with the C lexer it's always going to treat this state differently since it's an error in C/C++.
Regards, Matthew Brush
[0]: https://github.com/geany/geany-themes/blob/master/colorschemes/zenburn.conf#...