Closed Konfekt closed 8 years ago
What is the reason? Are you doing operations based on the buffer name? Or is it simply that you don't like quickfix-reflector
in the name when you don't edit the quickfix list? In that case, the easiest solution would be to remove the -reflector
in the buffer names and simply call a buffer quickfix-<buffer-number>
.
Yeah, no urge, but it would be least intrusive, and more robust. For example, a proper command :initQf
would make quickfix-reflector
work independent of previously triggered of autocmd
s.
I prefer the on-by-default approach. I feel this one of the charms of quickfix-reflector, the simplicity to use it without extra commands and mappings. So I don't really like adding commands, even if they are optional.
I do agree it's best not to be intrusive if possible. I removed the -reflector
in the buffer names to make them a little more neutral.
Ok, the idea was that instead of a mapping such as
autocmd FileType qf nnoremap <silent><buffer> r :set modifiable<cr>:nunmap <lt>buffer> r<CR>
(noting that let g:qf_modifiable=0
) something like ... r :QFreflectorInit<cr>
would be more effectual, but I understand g:qf_modifiable=0
was more of a concession contrary to the spirit of the plugin.
Exactly. Anyway, thanks for clarifying and for your interest in the plugin!
If I may reopen? An init function would still be appreciated. One reason is that scrolling through open buffers in an open window, say by mappings mapped to :bn/p
with an open quickfix-list below, will open the quick-fix window buffer. An init function is the cleanest solution in many ways, and adding an autoinit option, enabled by default, will leave everything backwards compatible.
Another quirk: When opening vim as a viewer, say by vim -R/M
, then opening the quickfix window, for example after (vim)grepping, throws an error that the quickfix buffer is not modifiable.
Regarding the init function. Even if I wanted to implement the functionality, it would cause some tricky situations and would need a lot of test cases or rather an extension of the current tests to make sure things work properly. I don't want to support that.
About scrolling through open buffers. Are you sure this is caused by quickfix-reflector? I tried this using vim -u NONE
. Simply a :copen
, changing back to the first window, and :bn
opens the quickfix buffer in the first window.
The error message in your last comment should be fixed now.
Ok, thanks for fixing the viewer (-M) issue.
Open file.txt
in vim, then :grep ...
, then cwindow
and now return to the window of file.txt
. Then :bn
is the quickfix-...` buffer.
Isn't this simply the buflist
property that should be switched off?
My point was: This is the default behaviour in Vim. It's not caused by
quickfix-reflector. Even without the plugin, the quickfix buffer has
buflisted
set.
Still (inconsitently) doesn't show up on :bn
. With qf-reflector
it does.
vim -u NONE
:e foo.txt
:grep 'line' foo.txt
<C-w><C-w>
:bn
This happens:
There's something fishy, here, with vim -u
:
:grep
does not automatically open the quick-fix windowsetlocal buflisted?
in the quickfix windo shows nobuflisted
Oh, I forgot to add :copen
after the grep command in my description. Indeed :grep
does not open the quickfix window on its own.
However, I still get buflisted
in the quickfix window.
Ok, I will check again. In any case, an
autocmd Filetype * setlocal nobuflisted
is fine.
As follow-up to
https://github.com/stefandtw/quickfix-reflector.vim/issues/6
and
https://github.com/stefandtw/quickfix-reflector.vim/issues/14
How about only setting the qf-buffer title, if
g:qf_modifiable=0
, when the qf buffer is made modifiable ? That would entail makings:OnQuickfixInit()
public though.