Skip to content

Commit

Permalink
Do not remove comments from property values
Browse files Browse the repository at this point in the history
As of spec 0.15.0, `;` and `#` do not start comments when used in property
values, and `\` does not escape `;` or `#`.  Remove the relevant code.
  • Loading branch information
cxw42 committed Oct 31, 2022
1 parent 77fa19f commit 8cdbbaf
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions autoload/editorconfig_core/ini.vim
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,6 @@ function! s:parse(config_filename, target_filename, lines)
echom printf('Saw raw opt <%s>=<%s>', l:optname, l:optval)
endif

if l:optval =~# '\v[;#]'
" ';' and '#' are comment delimiters only if
" preceded by a spacing character
let l:m = matchlist(l:optval, '\v(.{-})\s[;#]')
if len(l:m)
let l:optval = l:m[1]
endif

" ; and # can be escaped with backslash.
let l:optval = substitute(l:optval, '\v\\([;#])', '\1', 'g')

endif
let l:optval = editorconfig_core#util#strip(l:optval)
" allow empty values
if l:optval ==? '""'
Expand Down

0 comments on commit 8cdbbaf

Please sign in to comment.