ronakg / quickr-preview.vim

Quickly preview Quickfix results in vim without opening the file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

After opening a file that I was just previewing, the Search highlight persists

joeytwiddle opened this issue · comments

This is meant to be cleaned up by the following code:

function! QuickrPreviewExit()
    pclose!
    execute 'sign unplace 26'
endfunction

function! QuickrPreviewSetupExit()
    if &buftype == 'quickfix'
        autocmd BufDelete <buffer> call QuickrPreviewExit()
    endif
endfunction

augroup quickfix_cmds
    autocmd!
    autocmd BufCreate * call QuickrPreviewSetupExit()
augroup END

Can you confirm whether the BufDelete auto command is being triggered?

BufDelete should be getting triggered.

Sorry, ignore my previous comment. That will only work when closing/deleting the quickfix buffer, rather then when opening a file that was being previewed.

Commit ed3b58d will resolve this issue for unlisted buffers. I'll create another commit for listed buffers.

Tested it here, and the issue is no longer occurring. Fantastic work!