Skip to content

Commit 9138c59

Browse files
authored
Merge pull request #22 from keyserj/master
Shell escape file path before blaming
2 parents 20151ea + ea7683c commit 9138c59

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

autoload/blamer.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ function! s:GetLines() abort
9292
endfunction
9393

9494
function! blamer#GetMessage(file, line_number, line_count) abort
95-
let l:command = 'git --no-pager blame -p -L ' . a:line_number . ',' . a:line_count . ' -- ' . a:file
95+
let l:file_path_escaped = shellescape(a:file)
96+
let l:command = 'git --no-pager blame -p -L ' . a:line_number . ',' . a:line_count . ' -- ' . l:file_path_escaped
9697
let l:result = system(l:command)
9798

9899
let l:lines = split(l:result, '\n')
@@ -121,7 +122,7 @@ function! blamer#GetMessage(file, line_number, line_count) abort
121122
return ''
122123
endif
123124

124-
" Echo unkown errors in order to catch them
125+
" Echo unknown errors in order to catch them
125126
echo '[blamer.nvim] ' . l:result
126127
return ''
127128
endif

0 commit comments

Comments
 (0)