Skip to content

Commit

Permalink
ensure to unlet b:grammarous_preview_bufnr on 'quit' action (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Dec 21, 2017
1 parent 51ef519 commit ae39822
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion autoload/grammarous/info_win.vim
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,28 @@ endfunction

function! grammarous#info_win#action_quit()
let s:do_not_preview = 1
let preview_bufnr = bufnr('%')

quit!
unlet b:grammarous_preview_bufnr

" Consider the case where :quit! does not navigate to the buffer
" where :GrammarousCheck checked.
for bufnr in tabpagebuflist()
let b = getbufvar(bufnr, 'grammarous_preview_bufnr', -1)
if b != preview_bufnr
continue
endif

let winnr = bufwinnr(bufnr)
if winnr != -1
continue
endif

execute winnr . 'wincmd w'
unlet b:grammarous_preview_bufnr
wincmd p
return
endfor
endfunction

function! grammarous#info_win#update(e)
Expand Down

0 comments on commit ae39822

Please sign in to comment.