diff options
| author | Jakub Jirutka <jakub@jirutka.cz> | 2017-10-23 19:11:50 +0200 |
|---|---|---|
| committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-10-23 19:11:50 +0200 |
| commit | 777b9125829ffc29a1d50428a5059350d5053132 (patch) | |
| tree | 5044129424824ed7aa57f9371b37d907dafd530a /community/vim-editorconfig/fix-config-parsing.patch | |
| parent | 7536f303a4826647868a57542d67d625db7b9c1d (diff) | |
| download | aports-777b9125829ffc29a1d50428a5059350d5053132.tar.bz2 aports-777b9125829ffc29a1d50428a5059350d5053132.tar.xz | |
community/editorconfig: move from testing
Diffstat (limited to 'community/vim-editorconfig/fix-config-parsing.patch')
| -rw-r--r-- | community/vim-editorconfig/fix-config-parsing.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/community/vim-editorconfig/fix-config-parsing.patch b/community/vim-editorconfig/fix-config-parsing.patch new file mode 100644 index 0000000000..806407d405 --- /dev/null +++ b/community/vim-editorconfig/fix-config-parsing.patch @@ -0,0 +1,46 @@ +From 69f86d1077b226a7535b1dec06d5bbf0fb2a89cd Mon Sep 17 00:00:00 2001 +From: Jakub Jirutka <jakub@jirutka.cz> +Date: Mon, 23 Oct 2017 18:23:33 +0200 +Subject: [PATCH] Fix trimming of empty comments + +For example this .editorconfig: + +``` +; Lorem ipsum +; +; dolor sit amet + +root = true +``` + +is parsed incorrectly: + +s:parse_properties(...) -> [], {} + s:trim(...) -> [';', 'root = true'] + s:remove_comment(';') -> ';' + +This commit fixes this issue. + +Patch-Source: https://github.com/sgur/vim-editorconfig/pull/15 +--- + autoload/editorconfig.vim | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/autoload/editorconfig.vim b/autoload/editorconfig.vim +index b0e4240..469172d 100644 +--- a/autoload/editorconfig.vim ++++ b/autoload/editorconfig.vim +@@ -203,9 +203,11 @@ endfunction "}}} + " + " >>> echo s:remove_comment('bar') + " bar ++" >>> echo s:remove_comment('#') ++" + + function! s:remove_comment(line) abort "{{{ +- let pos = match(a:line, '\s*[;#].\+') ++ let pos = match(a:line, '\s*[;#].*') + return pos == -1 ? a:line : pos == 0 ? '' : a:line[: pos-1] + endfunction "}}} + +-- |
