Skip to content

Commit 3f6b71a

Browse files
committed
Remove length limits on sections/keys/values
editorconfig/editorconfig#429
1 parent 0818c7e commit 3f6b71a

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

.gitmodules

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
url = https://github.com/editorconfig/editorconfig-plugin-tests.git
44
[submodule "core_tests"]
55
path = tests/core/tests
6-
url = https://github.com/editorconfig/editorconfig-core-test.git
6+
url = https://github.com/goodhoko/editorconfig-core-test.git
7+
branch = feature/remove-length-limits

autoload/editorconfig_core/ini.vim

+5-16
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ endif
3939
" Allow ``]`` and escaped ``;`` and ``#`` characters in section headers.
4040
" In fact, allow \ to escape any single character - it needs to cover at
4141
" 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
4343
let s:SECTCRE = '\v^\s*\[(%([^\\#;]|\\.)+)\]'
4444

4545
" Regular expression for parsing option name/values.
@@ -48,11 +48,7 @@ let s:SECTCRE = '\v^\s*\[(%([^\\#;]|\\.)+)\]'
4848
" any characters to eol
4949
let s:OPTCRE = '\v\s*([^:=[:space:]][^:=]*)\s*([:=])\s*(.*)$'
5050

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
5652

5753
" }}}2
5854
" === Main ============================================================== {{{1
@@ -123,13 +119,8 @@ function! s:parse(config_filename, target_filename, lines)
123119
if len(l:mo)
124120
let l:sectname = l:mo[1]
125121
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)
133124

134125
if g:editorconfig_core_vimscript_debug
135126
echom 'In section ' . l:sectname . ', which ' .
@@ -177,9 +168,7 @@ function! s:parse(config_filename, target_filename, lines)
177168
echom printf('Saw opt <%s>=<%s>', l:optname, l:optval)
178169
endif
179170

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
183172
let l:options[l:optname] = l:optval
184173
endif
185174
else

0 commit comments

Comments
 (0)