From 77fa19f9de795204a419489e9c47bf9ca8d65cf0 Mon Sep 17 00:00:00 2001 From: Chris White Date: Mon, 31 Oct 2022 12:14:08 -0400 Subject: [PATCH 1/4] Update core-tests submodule --- tests/core/tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core/tests b/tests/core/tests index 6c8fe6815..5ca0b296d 160000 --- a/tests/core/tests +++ b/tests/core/tests @@ -1 +1 @@ -Subproject commit 6c8fe6815b12f96f4b357d610ee1cd8da074880a +Subproject commit 5ca0b296dc31124d0303895c163013450bd97958 From 8cdbbaf4a037f9ada37d29a52478cc9dd43b75e3 Mon Sep 17 00:00:00 2001 From: Chris White Date: Mon, 31 Oct 2022 12:18:02 -0400 Subject: [PATCH 2/4] Do not remove comments from property values 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. --- autoload/editorconfig_core/ini.vim | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/autoload/editorconfig_core/ini.vim b/autoload/editorconfig_core/ini.vim index d773323f1..e6b1674b4 100644 --- a/autoload/editorconfig_core/ini.vim +++ b/autoload/editorconfig_core/ini.vim @@ -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 ==? '""' From 89ca35f64fb4c095e813343a6b6ac07a4e10353c Mon Sep 17 00:00:00 2001 From: Chris White Date: Mon, 31 Oct 2022 12:26:57 -0400 Subject: [PATCH 3/4] Update property key, value length limits per spec change Increase the minimum key and value lengths to pass the tests added in . --- autoload/editorconfig_core/ini.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/editorconfig_core/ini.vim b/autoload/editorconfig_core/ini.vim index e6b1674b4..55d2dee4e 100644 --- a/autoload/editorconfig_core/ini.vim +++ b/autoload/editorconfig_core/ini.vim @@ -49,8 +49,8 @@ let s:SECTCRE = '\v^\s*\[(%([^\\#;]|\\.)+)\]' let s:OPTCRE = '\v\s*([^:=[:space:]][^:=]*)\s*([:=])\s*(.*)$' let s:MAX_SECTION_NAME = 4096 -let s:MAX_PROPERTY_NAME = 50 -let s:MAX_PROPERTY_VALUE = 255 +let s:MAX_PROPERTY_NAME = 1024 +let s:MAX_PROPERTY_VALUE = 4096 lockvar s:SECTCRE s:OPTCRE s:MAX_SECTION_NAME s:MAX_PROPERTY_NAME s:MAX_PROPERTY_VALUE From 4c15bbf5d950759b9159f0a478fd1adcf483ced1 Mon Sep 17 00:00:00 2001 From: Chris White Date: Mon, 31 Oct 2022 13:00:40 -0400 Subject: [PATCH 4/4] core: Fix matching with nested braces (#160) Port the change from to this core. --- autoload/editorconfig_core/fnmatch.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/autoload/editorconfig_core/fnmatch.vim b/autoload/editorconfig_core/fnmatch.vim index 6f60db5d0..ef9ced9fd 100644 --- a/autoload/editorconfig_core/fnmatch.vim +++ b/autoload/editorconfig_core/fnmatch.vim @@ -45,22 +45,24 @@ if !exists('g:editorconfig_core_vimscript_debug') endif " }}}1 " === Regexes =========================================================== {{{1 -let s:LEFT_BRACE = '\v%(^|[^\\])\{' +let s:LEFT_BRACE = '\v[\\]@8