`lexer.cpp.track.preprocessor` lexer properties affects which styles are used, and we don't set those, so no filetype inheriting C styles should set it to 1.
Similarly, some properties like `styling.within.preprocessor` are mostly general settings rather than selecting syntax details, so they should probably match in all filetypes for consistency.
So, inherit the C lexer_properties everywhere C styles are used, and only override specific properties in the inheriting filetype. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1217
-- Commit Summary --
* Inherit C lexer_properties in all filetypes inheriting C styles
-- File Changes --
M data/filedefs/filetypes.CUDA.conf (4) M data/filedefs/filetypes.Genie.conf (2) M data/filedefs/filetypes.Graphviz.conf (4) M data/filedefs/filetypes.JSON.conf (2) M data/filedefs/filetypes.Scala.conf (2) M data/filedefs/filetypes.actionscript (2) M data/filedefs/filetypes.cpp (4) M data/filedefs/filetypes.cs (4) M data/filedefs/filetypes.ferite (2) M data/filedefs/filetypes.glsl (4) M data/filedefs/filetypes.go (3) M data/filedefs/filetypes.haxe (2) M data/filedefs/filetypes.java (1) M data/filedefs/filetypes.javascript (2) M data/filedefs/filetypes.vala (4)
-- Patch Links --
https://github.com/geany/geany/pull/1217.patch https://github.com/geany/geany/pull/1217.diff
The only slight downside I see is that with this if we add a new C-specific lexer property in *filetypes.c*, it'll be inherited by everyone. However, it's kind of unlikely we do that, especially as *LexCPP* is *meant* for C and C++ highlighting, so the default feature set should target that, and extra properties will likely be there for *other* languages.
If there is a new lexer property added that we only want to apply to a specific filetype, can we not just specify it in the `[lexer_properties=C]` group, or does it not read the group at all if it inherits from another filetype?
Unless I'm mistaken (and this commit would break many things then), we can override everything we want, the `=C` part imports the keys from the other file, and next ones are read normally, overriding any previous value.
Seems OK to me then.
LGBI
Merged #1217.
github-comments@lists.geany.org