[Geany-Users] How to control the format of a word followed by a single quote character

Lex Trotman elextr at xxxxx
Sat Feb 10 06:36:06 UTC 2018


On 10 February 2018 at 14:45, Ethan Beyak <ethanbeyak at 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 at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>


More information about the Users mailing list