From 7b78f2b846e2f3443dcb2ceacee54eb99e37f040 Mon Sep 17 00:00:00 2001 From: w0rp Date: Wed, 5 Jun 2019 14:16:43 +0100 Subject: Fix #2525 - Convert Windows paths in a Unix environment --- autoload/ale/path.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'autoload') diff --git a/autoload/ale/path.vim b/autoload/ale/path.vim index 60d42eb5..84c26d0a 100644 --- a/autoload/ale/path.vim +++ b/autoload/ale/path.vim @@ -3,13 +3,20 @@ " simplify a path, and fix annoying issues with paths on Windows. " -" Forward slashes are changed to back slashes so path equality works better. +" Forward slashes are changed to back slashes so path equality works better +" on Windows. Back slashes are changed to forward slashes on Unix. +" +" Unix paths can technically contain back slashes, but in practice no path +" should, and replacing back slashes with forward slashes makes linters work +" in environments like MSYS. " " Paths starting with more than one forward slash are changed to only one " forward slash, to prevent the paths being treated as special MSYS paths. function! ale#path#Simplify(path) abort if has('unix') - return substitute(simplify(a:path), '^//\+', '/', 'g') " no-custom-checks + let l:unix_path = substitute(a:path, '\\', '/', 'g') + + return substitute(simplify(l:unix_path), '^//\+', '/', 'g') " no-custom-checks endif let l:win_path = substitute(a:path, '/', '\\', 'g') -- cgit v1.2.3