quickfix window's manual fix

23 views
Skip to first unread message

sinbad

unread,
Apr 27, 2011, 7:50:41 AM4/27/11
to vim_use
hi,

how to update the quickfix window manually.
with cscope quickfix i searched for some
symbol, and from the quickfix window i deleted
some entires manually now if i press :cnext
i want to go to (file,loc) with the updated
quickfix results, but it seems to be going
to the (file, loc) where manually deleted
entries were pointing to. any clue ?

thanks

Ben Fritz

unread,
Apr 27, 2011, 11:45:52 AM4/27/11
to vim_use
You cannot update the quickfix list manually with normal editing
commands in the quickfix window. This is why "nomodifiable" is set in
this buffer by default. You should not have expected it to work simply
by overriding that option, it is set for a reason. If you had read the
help, you would see the following under :help quickfix-window:

> The window will contain a special buffer, with
> 'buftype' equal to "quickfix". Don't change this!

and lower down:

> Note: Making changes in the quickfix window has no effect on the list of
> errors. 'modifiable' is off to avoid making changes. If you delete or insert
> lines anyway, the relation between the text and the error number is messed up.
> If you really want to do this, you could write the contents of the quickfix
> window to a file and use ":cfile" to have it parsed and used as the new error
> list.

What you CAN do is use the quickfix functions to modify the quickfix
list in a script. See :help quickfix-functions for a list of these
functions.

The other thing you can do is always check the :help before asking
about it if something does not work the way you'd expect.

jceb

unread,
Apr 29, 2011, 10:03:50 AM4/29/11
to vim_use
Hi,

The quickfix modification functions are rather difficult to use,
especially when you just want to edit one entry. For this reason I
created a vim script called editqf (http://www.vim.org/scripts/
script.php?script_id=3557). Basically you just press "i" in the
quickfix window. A new window will be opened where you can change the
quickfix entries. When you are done, just save/close the newly created
window with :w or :x.

I hope this is helpful to you.

Greetings,

Jan Christoph
Reply all
Reply to author
Forward
0 new messages