stefandtw/quickfix-reflector.vim

setting 'nobuflisted' changes 'modifyable' state

Closed this issue · 2 comments

I switch between buffers a lot with :bnext and the like (using vim-unimpared that is), and the quickfix buffer kept annoyingly showing up. So I i fixed this with the following in my .vimrc:

autocmd FileType qf set nobuflisted

But now the quickfix buffer is no longer modifiable for the quickfix-reflector. I've looked through the code, but can't find out what is going wrong. Is this something you can fix?

Edit:
As a matter of fact, the plugin doesn't seem to get loaded at all with this setting...
Edit2:
Okay, there are more of my .vimrc settings involved here. I'll research it and get back to you.

Okay nobuflisted was not the problem.

I'm using vim-fugitive and tpope suggests putting the following line in your .vimrc to make sure that when you run :Ggrep the quickfix window opens automatically.

autocmd QuickFixCmdPost *grep* cwindow

The cwindow command seems to cause problems with the quickfix-reflector plugin. Researching this a bit, I found out that when cwindow runs, the command OnQuickfixInit() in the plugin gets called first, and any QuickFixCmdPost command in the vimrc gets called second. For some reason cwindow seems to be overwriting any changes done in the quickfix-reflector. Swapping the BufReadPost with a QuickFixCmdPost in the plugin doesn't seem to change anything.

I tried to fix it for you somehow, but my knowledge of vimL and how vim runs isn't extensive enough. Can you fix this? Or might this be a bug in vim?

Not sure why it happens this way.

Try QuickFixCmdPre instead of QuickFixCmdPost in your autocmd. That seems to correctly trigger before anything else, and having the window open beforehand should work just as well as after.