From 43e8f47e6e8c4fd3cc7ea161120c320b85813efd Mon Sep 17 00:00:00 2001 From: w0rp Date: Sun, 18 Mar 2018 20:39:42 +0000 Subject: #1431 Normalize paths when checking for temporary paths on Windows --- autoload/ale/engine.vim | 3 --- autoload/ale/path.vim | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'autoload') diff --git a/autoload/ale/engine.vim b/autoload/ale/engine.vim index 89169874..dd871c36 100644 --- a/autoload/ale/engine.vim +++ b/autoload/ale/engine.vim @@ -366,9 +366,6 @@ function! s:RemapItemTypes(type_map, loclist) abort endfor endfunction -" Save the temporary directory so we can figure out if files are in it. -let s:temp_dir = fnamemodify(tempname(), ':h') - function! ale#engine#FixLocList(buffer, linter_name, loclist) abort let l:bufnr_map = {} let l:new_loclist = [] diff --git a/autoload/ale/path.vim b/autoload/ale/path.vim index 16dabf21..91832b35 100644 --- a/autoload/ale/path.vim +++ b/autoload/ale/path.vim @@ -84,12 +84,12 @@ function! ale#path#IsAbsolute(filename) abort return a:filename[:0] is# '/' || a:filename[1:2] is# ':\' endfunction -let s:temp_dir = fnamemodify(tempname(), ':h') +let s:temp_dir = ale#path#Simplify(fnamemodify(tempname(), ':h')) " Given a filename, return 1 if the file represents some temporary file " created by Vim. function! ale#path#IsTempName(filename) abort - return a:filename[:len(s:temp_dir) - 1] is# s:temp_dir + return ale#path#Simplify(a:filename)[:len(s:temp_dir) - 1] is# s:temp_dir endfunction " Given a base directory, which must not have a trailing slash, and a -- cgit v1.2.3