Weirdness
Closed this issue · 4 comments
Hi,
The highlighting rules are a bit rough, as you can see. In fact it needs to be rewritten, but I didn't bother too much yet: I tried, but since the current syntax file works (kind of), it is much work for little gain.
But of course, any help on that would be appreciated. ;)
I try to keep track of the syntax changes (new keywords, etc. ; this is defined in commands.spec
and config.spec
there). Generating the syntax file from these would be awesome, but it doesn't seem easy neither.
Now, about the problems pointed:
-
yes / no:
The values
1
,yes
,true
,on
,enable
andactive
are true, and the others are false. This is not defined in the*.spec
files but directly in the code: config_directives.c:124.A line such as
focus_follow_mouse do_not_want
is correct and equivalent to
focus_follow_mouse no
I will add
true
that is missing, but the negatives are not keywords. I could addno
,false
,disable
andinactive
for now; consistency is not a bad thing. -
keywords highlighted in incorrect places:
h
,v
, andx
are keywords (used as arguments, for example insplit v
orfloating_minimum_size 72 x 8
). The highlighting is not much aware of the surrounding context, so the keywords are highlighted almost anywhere they appears. The workspace/container problem is really the same: workspace is highlighted as a command on its own and not as an argument. Again, fixing this would require a full rewrite of the syntax file.
Thanks for the great informative reply. I haven't learned Vim's syntax highlighting yet but I plan to. Hope to help with this some day, and it's great knowing you're keeping track with i3 spec and syntax. cheers!
Your recent changes helped reduce the weirdness, thanks :)
You're welcome! :)