mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
@@ -118,7 +118,8 @@ endfunction
|
||||
let s:set_path_handler = {}
|
||||
|
||||
function! s:set_path_handler.out(buffer, listing) abort
|
||||
let [status, path] = split(s:strip_trailing_new_line(a:listing))
|
||||
let listing = s:strip_trailing_new_line(a:listing)
|
||||
let [status, path] = [listing[0], listing[2:]]
|
||||
if status =~ '[[:lower:]]'
|
||||
call gitgutter#utility#setbufvar(a:buffer, 'path', -3)
|
||||
else
|
||||
@@ -167,7 +168,8 @@ function! gitgutter#utility#set_repo_path(bufnr, continuation) abort
|
||||
return
|
||||
endif
|
||||
|
||||
let [status, path] = split(s:strip_trailing_new_line(listing))
|
||||
let listing = s:strip_trailing_new_line(listing)
|
||||
let [status, path] = [listing[0], listing[2:]]
|
||||
if status =~ '[[:lower:]]'
|
||||
call gitgutter#utility#setbufvar(a:bufnr, 'path', -3)
|
||||
else
|
||||
|
||||
@@ -205,6 +205,20 @@ function Test_filename_with_square_brackets()
|
||||
endfunction
|
||||
|
||||
|
||||
function Test_filename_with_space()
|
||||
call system('touch fix\ ture.txt && git add fix\ ture.txt')
|
||||
edit fix\ ture.txt
|
||||
normal ggo*
|
||||
call s:trigger_gitgutter()
|
||||
|
||||
let expected = [
|
||||
\ {'lnum': 1, 'name': 'GitGutterLineAdded'},
|
||||
\ {'lnum': 2, 'name': 'GitGutterLineAdded'}
|
||||
\ ]
|
||||
call s:assert_signs(expected, 'fix\ ture.txt')
|
||||
endfunction
|
||||
|
||||
|
||||
function Test_filename_leading_dash()
|
||||
call system('touch -- -fixture.txt && git add -- -fixture.txt')
|
||||
edit -fixture.txt
|
||||
|
||||
Reference in New Issue
Block a user