mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +00:00
fix(editorconfig): highlight properties with dashes (#24407)
also add metadata comment and update Lua code in syntax file
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