From 4bc31fcd18bda03f0de516be0380d6885cdd3d9b Mon Sep 17 00:00:00 2001 From: Marcus Zanona Date: Thu, 9 Nov 2017 13:45:14 -0200 Subject: [PATCH] Fix imported files path lookup on less#lessc linter Ale saves a temporary file (%t) which does not share the same path as the original file, breaking import statements with relative URLs. This fix sends content to `lessc` over stdin and adds the current file (%s) as one of the included paths, so statements like `@import '../utils' will correctly resolve based on the current file path. --- ale_linters/less/lessc.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ale_linters/less/lessc.vim b/ale_linters/less/lessc.vim index db871ac..1c5df91 100755 --- a/ale_linters/less/lessc.vim +++ b/ale_linters/less/lessc.vim @@ -4,10 +4,10 @@ call ale#Set('less_lessc_options', '') function! ale_linters#less#lessc#GetCommand(buffer) abort - return 'lessc' - \ . ' --no-color --lint' + return 'cat %t | lessc' + \ . ' --no-color --lint --include-path=' . expand('%:p:h') \ . ' ' . ale#Var(a:buffer, 'less_lessc_options') - \ . ' %t' + \ . ' -' endfunction function! ale_linters#less#lessc#Handle(buffer, lines) abort