diff options
author | ObserverOfTime <chronobserver@disroot.org> | 2023-07-27 15:39:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 14:39:05 +0200 |
commit | df2f5e39127e283a7ac74a21cb0323c437c3294f (patch) | |
tree | bed7455fbcb1ae1a027616efb0a209a00d82450b | |
parent | 41cefe513054edd1c12f235125220dbc6b4d9451 (diff) | |
download | rneovim-df2f5e39127e283a7ac74a21cb0323c437c3294f.tar.gz rneovim-df2f5e39127e283a7ac74a21cb0323c437c3294f.tar.bz2 rneovim-df2f5e39127e283a7ac74a21cb0323c437c3294f.zip |
fix(editorconfig): highlight properties with dashes (#24407)
also add metadata comment and update Lua code in syntax file
-rw-r--r-- | runtime/syntax/editorconfig.vim | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/runtime/syntax/editorconfig.vim b/runtime/syntax/editorconfig.vim index 4392d2b2d5..74a0e56131 100644 --- a/runtime/syntax/editorconfig.vim +++ b/runtime/syntax/editorconfig.vim @@ -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 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 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, ' '))) +local props = vim.tbl_keys(require('editorconfig').properties) +vim.cmd.syntax { 'keyword', 'editorconfigProperty', unpack(props) } . hi def link editorconfigProperty dosiniLabel |