mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
Merge pull request #24906 from neovim/backport-24407-to-release-0.9
[Backport release-0.9] fix(editorconfig): highlight properties with dashes
This commit is contained in:
@@ -1,15 +1,18 @@
|
|||||||
|
" Nvim syntax file
|
||||||
|
" Language: EditorConfig
|
||||||
|
" Last Change: 2023-07-20
|
||||||
|
"
|
||||||
|
" This file is intentionally _not_ copied from Vim.
|
||||||
|
|
||||||
runtime! syntax/dosini.vim
|
runtime! syntax/dosini.vim
|
||||||
unlet! b:current_syntax
|
unlet! b:current_syntax
|
||||||
|
|
||||||
syntax match editorconfigUnknownProperty "^\s*\zs\w\+\ze\s*="
|
syntax match editorconfigUnknownProperty "^\s*\zs[a-zA-Z0-9_-]\+\ze\s*="
|
||||||
syntax keyword editorconfigProperty root
|
syntax keyword editorconfigProperty root
|
||||||
|
|
||||||
lua<<
|
lua<<
|
||||||
local props = {}
|
local props = vim.tbl_keys(require('editorconfig').properties)
|
||||||
for k in pairs(require('editorconfig').properties) do
|
vim.cmd.syntax { 'keyword', 'editorconfigProperty', unpack(props) }
|
||||||
props[#props + 1] = k
|
|
||||||
end
|
|
||||||
vim.cmd(string.format('syntax keyword editorconfigProperty %s', table.concat(props, ' ')))
|
|
||||||
.
|
.
|
||||||
|
|
||||||
hi def link editorconfigProperty dosiniLabel
|
hi def link editorconfigProperty dosiniLabel
|
||||||
|
Reference in New Issue
Block a user