39
39
" Allow ``]`` and escaped ``;`` and ``#`` characters in section headers.
40
40
" In fact, allow \ to escape any single character - it needs to cover at
41
41
" least \ * ? [ ! ] { }.
42
- unlockvar s: SECTCRE s: OPTCRE s: MAX_SECTION_NAME s: MAX_PROPERTY_NAME s: MAX_PROPERTY_VALUE
42
+ unlockvar s: SECTCRE s: OPTCRE
43
43
let s: SECTCRE = ' \v^\s*\[(%([^\\#;]|\\.)+)\]'
44
44
45
45
" Regular expression for parsing option name/values.
@@ -48,11 +48,7 @@ let s:SECTCRE = '\v^\s*\[(%([^\\#;]|\\.)+)\]'
48
48
" any characters to eol
49
49
let s: OPTCRE = ' \v\s*([^:=[:space:]][^:=]*)\s*([:=])\s*(.*)$'
50
50
51
- let s: MAX_SECTION_NAME = 4096
52
- let s: MAX_PROPERTY_NAME = 50
53
- let s: MAX_PROPERTY_VALUE = 255
54
-
55
- lockvar s: SECTCRE s: OPTCRE s: MAX_SECTION_NAME s: MAX_PROPERTY_NAME s: MAX_PROPERTY_VALUE
51
+ lockvar s: SECTCRE s: OPTCRE
56
52
57
53
" }}}2
58
54
" === Main ============================================================== {{{1
@@ -123,13 +119,8 @@ function! s:parse(config_filename, target_filename, lines)
123
119
if len (l: mo )
124
120
let l: sectname = l: mo [1 ]
125
121
let l: in_section = 1
126
- if strlen (l: sectname ) > s: MAX_SECTION_NAME
127
- " Section name too long => ignore the section
128
- let l: matching_section = 0
129
- else
130
- let l: matching_section = s: matches_filename (
131
- \ a: config_filename , a: target_filename , l: sectname )
132
- endif
122
+ let l: matching_section = s: matches_filename (
123
+ \ a: config_filename , a: target_filename , l: sectname )
133
124
134
125
if g: editorconfig_core_vimscript_debug
135
126
echom ' In section ' . l: sectname . ' , which ' .
@@ -177,9 +168,7 @@ function! s:parse(config_filename, target_filename, lines)
177
168
echom printf (' Saw opt <%s>=<%s>' , l: optname , l: optval )
178
169
endif
179
170
180
- if l: matching_section &&
181
- \ strlen (l: optname ) <= s: MAX_PROPERTY_NAME &&
182
- \ strlen (l: optval ) <= s: MAX_PROPERTY_VALUE
171
+ if l: matching_section
183
172
let l: options [l: optname ] = l: optval
184
173
endif
185
174
else
0 commit comments