Skip to content

Commit

Permalink
Check for existence of signs before clearing.
Browse files Browse the repository at this point in the history
This fixes a bug whereby opening Vim on a non-git tracked file, then
calling `:DisableGitGutter` or `:ToggleGitGutter`, tried to clear a
variable before it had been defined.
  • Loading branch information
airblade committed Mar 1, 2013
1 parent eec6b68 commit 5a48d86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/gitgutter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ endfunction
" Sign processing {{{

function! s:clear_signs(file_name)
if has_key(s:sign_ids, a:file_name)
if exists('s:sign_ids') && has_key(s:sign_ids, a:file_name)
for id in s:sign_ids[a:file_name]
exe ":sign unplace " . id . " file=" . a:file_name
endfor
Expand Down

0 comments on commit 5a48d86

Please sign in to comment.