Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor syntax highlighting issue with swayconfig files #14826

Closed
diegoviola opened this issue May 22, 2024 · 3 comments · Fixed by neovim/neovim#28951
Closed

Minor syntax highlighting issue with swayconfig files #14826

diegoviola opened this issue May 22, 2024 · 3 comments · Fixed by neovim/neovim#28951

Comments

@diegoviola
Copy link
Contributor

diegoviola commented May 22, 2024

Steps to reproduce

This is a continuation of #14752, syntax highlighting improved a lot but there is still a minor issue with the following config:

floating_modifier $mod normal

The "normal" string shows up as red.

Here's a screenshot of what it currently looks like:

20240522_15h22m56s_grim

Expected behaviour

Syntax highlighting is properly applied to all commands.

Version of Vim

9.1.429

Environment

Operating system: Arch Linux
Terminal: foot
Value of $TERM: foot
Shell: /usr/bin/bash

Logs and stack traces

No response

@diegoviola
Copy link
Contributor Author

Should have been labelled as bug, and not enhancement. Anyway, @JosefLitos @jamespeapen (ping).

@jamespeapen
Copy link
Contributor

I can replicate this. It looks like contained was introduced in 679f5ab to floating_modifier in swayconfig.vim which seems to conflict with the i3 floating_modifier.

-syn match i3ConfigKeyword /^floating_modifier [$a-zA-Z0-9+]\+ \(normal\|inverse\)$/ contains=i3ConfigVariable,i3ConfigBindModkey,swayConfigFloatingModifierOpts
+syn match i3ConfigKeyword /floating_modifier [$a-zA-Z0-9+]\+ \(normal\|inverse\)$/ contained contains=i3ConfigVariable,i3ConfigBindModkey,swayConfigFloatingModifierOpts

Removing this fixes this problem. However, on checking the docs, it looks like floating_modifier none is a valid option that the syntax does not currently cover so I'll send a fix with both.

@diegoviola
Copy link
Contributor Author

@jamespeapen Thanks a lot again for your amazing work!

clason added a commit to clason/neovim that referenced this issue May 23, 2024
…ifier none; revert broken highlighting

- fix floating_modifier $mod normal|inverse was being hightlighted as error
  reverting the floating_modifier change from dd83b63
- will currently allow invalid syntax after floating_modifier

fixes: vim/vim#14826
closes: vim/vim#14827

vim/vim@22ac941

Co-authored-by: James Eapen <james.eapen@vai.org>
Co-authored-by: JosefLitos <litosjos@fit.cvut.cz>
clason added a commit to neovim/neovim that referenced this issue May 24, 2024
…ifier none; revert broken highlighting

- fix floating_modifier $mod normal|inverse was being hightlighted as error
  reverting the floating_modifier change from dd83b63
- will currently allow invalid syntax after floating_modifier

fixes: vim/vim#14826
closes: vim/vim#14827

vim/vim@22ac941

Co-authored-by: James Eapen <james.eapen@vai.org>
Co-authored-by: JosefLitos <litosjos@fit.cvut.cz>
huangyingw pushed a commit to huangyingw/neovim that referenced this issue May 31, 2024
…ifier none; revert broken highlighting

- fix floating_modifier $mod normal|inverse was being hightlighted as error
  reverting the floating_modifier change from dd83b63
- will currently allow invalid syntax after floating_modifier

fixes: vim/vim#14826
closes: vim/vim#14827

vim/vim@22ac941

Co-authored-by: James Eapen <james.eapen@vai.org>
Co-authored-by: JosefLitos <litosjos@fit.cvut.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants