Skip to content

Commit

Permalink
fix: handle windows directories
Browse files Browse the repository at this point in the history
  • Loading branch information
lervag committed Mar 27, 2024
1 parent 73605f8 commit fb7809f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions autoload/vimtex/paths.vim
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ function! vimtex#paths#relative(path, current) abort " {{{1

let l:target = simplify(substitute(a:path, '\\', '/', 'g'))
let l:common = simplify(substitute(a:current, '\\', '/', 'g'))
if l:common[-1:] ==# '/'
let l:common = l:common[:-2]
endif

if has('win32') || v:true
let l:target = substitute(l:target, '^[A-Z]:', '', '')
let l:common = substitute(l:common, '^[A-Z]:', '', '')
endif

" This only works on absolute paths
if !vimtex#paths#is_abs(l:target)
Expand Down

0 comments on commit fb7809f

Please sign in to comment.