Skip to content

Commit

Permalink
Close spurious preview window on tag not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
ches committed Feb 16, 2015
1 parent d8167f5 commit ad6abc5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plugin/vim-erlang-tags.vim
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,15 @@ endfunction
function! s:ExecWithPreviewHeight(cmd, height)
let orig_height = &previewheight
let &previewheight = a:height
execute a:cmd
let &previewheight = orig_height

try
execute a:cmd
catch /E426/ " tag not found
pclose " Spurious preview window is left open, close it.
echohl WarningMsg | echom v:exception | echohl None
finally
let &previewheight = orig_height
endtry
endfunction

function! VimErlangTagsDefineMappings()
Expand Down

0 comments on commit ad6abc5

Please sign in to comment.