From daa1c6bacdba832e6bee2034afd5a8902d487adc Mon Sep 17 00:00:00 2001 From: John Varouhakis Date: Sun, 6 Sep 2015 12:16:57 +0300 Subject: [PATCH 1/3] Delete and append instead of setline, to prevent bug when result lines are less than the initial --- plugin/csscomb.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/csscomb.vim b/plugin/csscomb.vim index dae1b6b..8d14b33 100644 --- a/plugin/csscomb.vim +++ b/plugin/csscomb.vim @@ -16,7 +16,9 @@ function! g:CSScomb(count, line1, line2) echoerr split(systemOutput, "\n")[1] else let lines = readfile(tempFile) - call setline(a:line1, lines) + exec a:line1.",".a:line2."delete" + let a:line0 = a:line1-1 + call append(a:line0, lines) endif endfunction From 000659053c844b37bacfd934d29b3d5bdaa226e4 Mon Sep 17 00:00:00 2001 From: John Varouchakis Date: Thu, 2 Jun 2016 13:03:29 +0300 Subject: [PATCH 2/3] use local config --- plugin/csscomb.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/csscomb.vim b/plugin/csscomb.vim index 8d14b33..ddd7655 100644 --- a/plugin/csscomb.vim +++ b/plugin/csscomb.vim @@ -11,7 +11,7 @@ function! g:CSScomb(count, line1, line2) let tempFile = tempname() . '.' . &filetype call writefile(content, tempFile) - let systemOutput = system('csscomb ' . shellescape(tempFile)) + let systemOutput = system('csscomb -c ~/.csscomb.json' . shellescape(tempFile)) if len(systemOutput) echoerr split(systemOutput, "\n")[1] else From 88b46a43ff02babdaff7ba462853d09350934af0 Mon Sep 17 00:00:00 2001 From: John Varouchakis Date: Tue, 7 Jun 2016 08:31:13 +0300 Subject: [PATCH 3/3] missing space --- plugin/csscomb.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/csscomb.vim b/plugin/csscomb.vim index ddd7655..3fbf6cf 100644 --- a/plugin/csscomb.vim +++ b/plugin/csscomb.vim @@ -11,7 +11,7 @@ function! g:CSScomb(count, line1, line2) let tempFile = tempname() . '.' . &filetype call writefile(content, tempFile) - let systemOutput = system('csscomb -c ~/.csscomb.json' . shellescape(tempFile)) + let systemOutput = system('csscomb -c ~/.csscomb.json ' . shellescape(tempFile)) if len(systemOutput) echoerr split(systemOutput, "\n")[1] else