Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/vimPublic

runtime(swayconfig): accept bar id passed as an argument#18814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
kupospelov wants to merge1 commit intovim:master
base:master
Choose a base branch
Loading
fromkupospelov:master

Conversation

@kupospelov
Copy link

Unlike i3, sway supports passing an optional bar id as an argument forbar.

@chrisbra
Copy link
Member

ping@litoj@jamespeapen

@litoj
Copy link
Contributor

litoj commentedNov 27, 2025
edited
Loading

I think a couple small changes should be done:

  • the id is not a keyword, so we shouldn't be highlighting it as one
  • we already have a match for bar block without the id, therefore the id in this group should be required
  • since the id is basically any kind of text value we should account for that

My suggestion:

synregionswayConfigBarBlockAfterIdstart=/{$/end=/^\s*}\zs$/containedcontains=i3ConfigBarOpts,i3ConfigComment,i3ConfigParen,i3ConfigBindKeyword,i3ConfigColorsBlockfoldkeependextendsynmatchswayConfigBarId/[^{]*/containedcontains=@i3ConfigStrVarsynregioni3ConfigBarBlockmatchgroup=i3ConfigKeywordstart=/bar\ze [^{]/end=/\ze{$/containedcontains=swayConfigBarIdnextgroup=swayConfigBarBlockAfterId...hideflinkswayConfigBarIdi3ConfigString

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.

Unlike i3, sway supports passing an optional bar idas an argument for `bar`.
@kupospelov
Copy link
Author

Those are good points, thanks!

Actually, what we need here is kind of similar to other regions likeinput,output, orseat. The only difference is that the identifier is optional. I definedswayConfigBar andswayConfigBarIdent, andbar can now be followed by either one of them.

@litoj
Copy link
Contributor

litoj commentedNov 28, 2025
edited
Loading

We could do it that way, but that requires other changes as well:

  • currently, thefonts keyword usescontainedin to inject itself into the bar block, which doesn't work when we create a group with a different name
  • the identifier can also be a string so we shouldn't be matching by non-space but rather non-{
  • we'd have to removei3ConfigBarBlock from@i3ConfigTopLevelDirective and replace it withswayConfigBarBlock

Note: my previous solution doesn't work with the fonts either, so we have to change them to a separate highlight group anyway (and add them to top-level directive)

litoj added a commit to litoj/i3config.vim that referenced this pull requestNov 28, 2025
This is an implementation ofvim/vim#18814.All code regarding identifiers was updated to have a unanymous style.All identifiers are now highlighted with their own group, linking to`i3ConfigIdent`.
@litoj
Copy link
Contributor

litoj commentedNov 28, 2025
edited
Loading

Since the way identifiers were highlighted was a little confusing overall I decided to apply the approach here from@kupospelov to all i3/sway identifier matchers 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?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@kupospelov@chrisbra@litoj

[8]ページ先頭

©2009-2025 Movatter.jp