Handle filenames containing equals signs.

This commit is contained in:
Andy Stewart
2015-10-13 12:37:49 +01:00
parent 1067294cdc
commit a30ee7f23e
4 changed files with 18 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ function! gitgutter#sign#find_current_signs()
silent execute "sign place buffer=" . bufnr
redir END
for sign_line in filter(split(signs, '\n'), 'v:val =~# "="')
for sign_line in filter(split(signs, '\n')[2:], 'v:val =~# "="')
" Typical sign line: line=88 id=1234 name=GitGutterLineAdded
" We assume splitting is faster than a regexp.
let components = split(sign_line)

0
test/=fixture=.txt Normal file
View File

View File

@@ -0,0 +1,5 @@
--- Signs ---
Signs for =fixture=.txt:
line=1 id=3000 name=GitGutterLineAdded
line=2 id=3001 name=GitGutterLineAdded

View File

@@ -0,0 +1,12 @@
source helper.vim
edit =fixture=.txt
normal ggo*
try
write
write
call DumpSigns('filenameWithEquals')
finally
call system('git reset HEAD =fixture=.txt')
call system('git checkout =fixture=.txt')
endtry