Friday, April 10, 2015

quickfix information

Hello,

I'm looking for a way to have (buffer-local) variables persist in quickfix buffers -- e.g. project name and compilation mode which are likely (expected in my scenarios) to change between two calls to :make.

:cclose seems to trigger a wipeout of the buffer -- thus all buffer variables are lost. And still when we play with getqflist(), :copen/:cprev/:cnew we are able to recover the list of quickfix messages. The quickfix information is not lost whilst the the buffer information is. Thus, I've tried to inject an item in the quickfix list, but we cannot use fields that are not expected. For instance

let l = getqflist()
l[0].mydata = {'foobar': [1, 2, 42] }
call setqflist(l)

echo has_key(getqflist()[0], 'mydata')

prints 0


I could inject a fake entry where I'd use 'nr' field as an id to dictionary of quickfix buffers. But is there a better and neater way to proceed ? Or the only persistent qf information is the qflist ?

--
Luc Hermitte
https://github.com/LucHermitte

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment