Skip to content

Commit 1953c0f

Browse files
authored
Merge pull request #199 from cxw42/update-tests
core: Update tests; fix bugs
2 parents 30ddc05 + 4c15bbf commit 1953c0f

3 files changed

Lines changed: 9 additions & 19 deletions

File tree

autoload/editorconfig_core/fnmatch.vim

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,24 @@ if !exists('g:editorconfig_core_vimscript_debug')
4545
endif
4646
" }}}1
4747
" === Regexes =========================================================== {{{1
48-
let s:LEFT_BRACE = '\v%(^|[^\\])\{'
48+
let s:LEFT_BRACE = '\v[\\]@8<!\{'
49+
" 8 is an arbitrary byte-count limit to the lookbehind (micro-optimization)
4950
"LEFT_BRACE = re.compile(
5051
" r"""
5152
"
52-
" (?: ^ | [^\\] ) # Beginning of string or a character besides "\"
53+
" (?<! \\ ) # Not preceded by "\"
5354
"
5455
" \{ # "{"
5556
"
5657
" """, re.VERBOSE
5758
")
5859

59-
let s:RIGHT_BRACE = '\v%(^|[^\\])\}'
60+
let s:RIGHT_BRACE = '\v[\\]@8<!\}'
61+
" 8 is an arbitrary byte-count limit to the lookbehind (micro-optimization)
6062
"RIGHT_BRACE = re.compile(
6163
" r"""
6264
"
63-
" (?: ^ | [^\\] ) # Beginning of string or a character besides "\"
65+
" (?<! \\ ) # Not preceded by "\"
6466
"
6567
" \} # "}"
6668
"

autoload/editorconfig_core/ini.vim

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ let s:SECTCRE = '\v^\s*\[(%([^\\#;]|\\.)+)\]'
4949
let s:OPTCRE = '\v\s*([^:=[:space:]][^:=]*)\s*([:=])\s*(.*)$'
5050

5151
let s:MAX_SECTION_NAME = 4096
52-
let s:MAX_PROPERTY_NAME = 50
53-
let s:MAX_PROPERTY_VALUE = 255
52+
let s:MAX_PROPERTY_NAME = 1024
53+
let s:MAX_PROPERTY_VALUE = 4096
5454

5555
lockvar s:SECTCRE s:OPTCRE s:MAX_SECTION_NAME s:MAX_PROPERTY_NAME s:MAX_PROPERTY_VALUE
5656

@@ -155,18 +155,6 @@ function! s:parse(config_filename, target_filename, lines)
155155
echom printf('Saw raw opt <%s>=<%s>', l:optname, l:optval)
156156
endif
157157

158-
if l:optval =~# '\v[;#]'
159-
" ';' and '#' are comment delimiters only if
160-
" preceded by a spacing character
161-
let l:m = matchlist(l:optval, '\v(.{-})\s[;#]')
162-
if len(l:m)
163-
let l:optval = l:m[1]
164-
endif
165-
166-
" ; and # can be escaped with backslash.
167-
let l:optval = substitute(l:optval, '\v\\([;#])', '\1', 'g')
168-
169-
endif
170158
let l:optval = editorconfig_core#util#strip(l:optval)
171159
" allow empty values
172160
if l:optval ==? '""'

0 commit comments

Comments
 (0)