mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Fix base_path() to handle filenames with colons
This bug was introduced when teaching gitgutter to handle file moves in #872. Fixes #877.
This commit is contained in:
@@ -252,7 +252,8 @@ function! gitgutter#utility#base_path(bufnr)
|
||||
" If we already know the original path at this diff base, return it.
|
||||
let basepath = gitgutter#utility#getbufvar(a:bufnr, 'basepath', '')
|
||||
if !empty(basepath)
|
||||
let [base, bpath] = split(basepath, ':', 1)
|
||||
let i = strridx(basepath, ':')
|
||||
let [base, bpath] = [basepath[0:i-1], basepath[i+1:]]
|
||||
if base == diffbase
|
||||
return gitgutter#utility#shellescape(bpath)
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user