neovim/runtime/syntax/editorconfig.vim
Gregory Anders f601c4b1ca
fix(editorconfig): do not highlight unknown properties as errors (#21673)
Other plugins may define their own custom properties outside of Neovim's
builtin EditorConfig support. Instead of highlighting these unknown
properties as errors, do not highlight them at all.

This still differentiates between known and unknown properties, which
helps to catch typos or mistakes, but does not use the garish "error"
highlight that signals something is wrong.
2023-01-07 08:20:55 -07:00

18 lines
439 B
VimL

runtime! syntax/dosini.vim
unlet! b:current_syntax
syntax match editorconfigUnknownProperty "^\s*\zs\w\+\ze\s*="
syntax keyword editorconfigProperty root
lua<<
local props = {}
for k in pairs(require('editorconfig').properties) do
props[#props + 1] = k
end
vim.cmd(string.format('syntax keyword editorconfigProperty %s', table.concat(props, ' ')))
.
hi def link editorconfigProperty dosiniLabel
let b:current_syntax = 'editorconfig'