diff options
author | Marcus Zanona <marcus@zanona.co> | 2017-11-09 13:45:14 -0200 |
---|---|---|
committer | Marcus Zanona <marcus@zanona.co> | 2017-11-09 13:46:03 -0200 |
commit | 4bc31fcd18bda03f0de516be0380d6885cdd3d9b (patch) | |
tree | ab720aa9e0733fa0962b76c3d3e5e7e91dca7958 | |
parent | 7ed82ab712324eb410279b95d852659e97ff9021 (diff) | |
download | ale-4bc31fcd18bda03f0de516be0380d6885cdd3d9b.zip |
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.
-rwxr-xr-x | ale_linters/less/lessc.vim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ale_linters/less/lessc.vim b/ale_linters/less/lessc.vim index db871ac2..1c5df915 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 |