Unlike i3, sway supports passing an optional bar id as an argument for bar.
https://github.com/vim/vim/pull/18814
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
ping @litoj @jamespeapen
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I think a couple small changes should be done:
My suggestion:
syn region swayConfigBarBlockAfterId start=/{$/ end=/^\s*}\zs$/ contained contains=i3ConfigBarOpts,i3ConfigComment,i3ConfigParen,i3ConfigBindKeyword,i3ConfigColorsBlock fold keepend extend syn match swayConfigBarId /[^{]*/ contained contains=@i3ConfigStrVar syn region i3ConfigBarBlock matchgroup=i3ConfigKeyword start=/bar\ze [^{]/ end=/\ze{$/ contained contains=swayConfigBarId nextgroup=swayConfigBarBlockAfterId ... hi def link swayConfigBarId i3ConfigString
It is a little more convoluted, but it ensures only the id is allowed to be a string or a variable and not the contents of the block, while highlighting the ID as a string by default.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@kupospelov pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Those are good points, thanks!
Actually, what we need here is kind of similar to other regions like input, output, or seat. The only difference is that the identifier is optional. I defined swayConfigBar and swayConfigBarIdent, and bar can now be followed by either one of them.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
We could do it that way, but that requires other changes as well:
fonts keyword uses containedin to inject itself into the bar block, which doesn't work when we create a group with a different name{i3ConfigBarBlock from @i3ConfigTopLevelDirective and replace it with swayConfigBarBlock—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Since the way identifiers were highlighted was a little confusing overall I decided to apply the approach here from @kupospelov to all syntax identifier across both syntax files. I updated it in the plugin repo - litoj/i3config.vim@e665b92
@kupospelov Could you please mirror it into your PR to merge those changes?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()