From 4bece27bd4f7a5645235b308b121fdae01fb3ab1 Mon Sep 17 00:00:00 2001 From: Khaveesh N Date: Fri, 21 Aug 2020 17:19:22 +0530 Subject: [PATCH 1/2] refactor(Fixer): Change latexindent to read from stdin instead of temporary file This is a better strategy as it avoids creating temporary files and the delay that follows --- autoload/ale/fixers/latexindent.vim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/autoload/ale/fixers/latexindent.vim b/autoload/ale/fixers/latexindent.vim index b0a0884a..54f1231e 100644 --- a/autoload/ale/fixers/latexindent.vim +++ b/autoload/ale/fixers/latexindent.vim @@ -10,9 +10,7 @@ function! ale#fixers#latexindent#Fix(buffer) abort return { \ 'command': ale#Escape(l:executable) - \ . ' -l -w' + \ . ' -l' \ . (empty(l:options) ? '' : ' ' . l:options) - \ . ' %t', - \ 'read_temporary_file': 1, \} endfunction From 76801743cf18e69a6dec86947243b6ec55530c7b Mon Sep 17 00:00:00 2001 From: Khaveesh N Date: Fri, 21 Aug 2020 17:29:43 +0530 Subject: [PATCH 2/2] Fixed tests --- test/fixers/test_latexindent_fixer_callback.vader | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/fixers/test_latexindent_fixer_callback.vader b/test/fixers/test_latexindent_fixer_callback.vader index d0da94a1..a440ed65 100644 --- a/test/fixers/test_latexindent_fixer_callback.vader +++ b/test/fixers/test_latexindent_fixer_callback.vader @@ -18,10 +18,8 @@ Execute(The latexindent callback should return the correct default values): AssertEqual \ { - \ 'read_temporary_file': 1, \ 'command': ale#Escape('xxxinvalid') - \ . ' -l -w' - \ . ' %t', + \ . ' -l' \ }, \ ale#fixers#latexindent#Fix(bufnr('')) @@ -31,10 +29,8 @@ Execute(The latexindent callback should include custom gofmt options): AssertEqual \ { - \ 'read_temporary_file': 1, \ 'command': ale#Escape('xxxinvalid') - \ . ' -l -w' + \ . ' -l' \ . ' ' . g:ale_tex_latexindent_options - \ . ' %t', \ }, \ ale#fixers#latexindent#Fix(bufnr(''))