New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select/set current quickfix list by id/number / goto non-current list entry #3699
Comments
Hi,
On Sun, Dec 16, 2018 at 9:03 AM Daniel Hahler ***@***.***> wrote:
Currently there appears to be only :colder/:cnewer to select a quickfix
list, which uses relative counts (by number), and therefore it is not
trivial to select a specific number (that you can get using getqflist({'id':
qfid, 'nr': 1}), but you would have to get the current number and then do a
relative :colder/:cnewer. I think it would be nice being able to select a
specific list by id. Not sure if selection by number is useful, because this
might rotate (there are only 10).
After seeing the reddit discussion about the Vim advent article on the colder
command (https://vimways.org/2018/colder-quickfix-lists/), I was thinking
about adding the support for jumping to a particular list in the stack.
I don't want to add a new command for this. I am looking for ways
to extend one of the existing :colder/:cnewer/:chistory commands to
support this. Can we extend the :chistory command to take a list number
in the stack?
My use case / idea is to temporarily switch the lists for :cc/:ll (wrapped
by a command to go to nearest entries according to the cursor position).
For this specific use case it would be best if temporarily switching the
current list would not be necessary in the first place, i.e. it would be
good if :cc / :ll could be called on a non-current list - likely done best
through a new function?! - but maybe also :[id]cc [count] could be used?!
This way plugins could go to next/prev/specific entries from their list,
which must not be the one currently being displayed in the quickfix window.
Currently only the setqflist() and getqflist() functions use the quickfix
list identifier. The quickfix commands use only the list number in
the stack. Changing this will break backward compatibility. We can
add support for changing the current entry in a list using the
setqflist() function.
- Yegappan
|
Hi,
On Sun, Dec 16, 2018 at 9:50 AM Yegappan Lakshmanan ***@***.***> wrote:
Hi,
On Sun, Dec 16, 2018 at 9:03 AM Daniel Hahler ***@***.***> wrote:
>
> My use case / idea is to temporarily switch the lists for :cc/:ll (wrapped
> by a command to go to nearest entries according to the cursor position).
> For this specific use case it would be best if temporarily switching the
> current list would not be necessary in the first place, i.e. it would be
> good if :cc / :ll could be called on a non-current list - likely done best
> through a new function?! - but maybe also :[id]cc [count] could be used?!
> This way plugins could go to next/prev/specific entries from their list,
> which must not be the one currently being displayed in the quickfix window.
>
Currently only the setqflist() and getqflist() functions use the quickfix
list identifier. The quickfix commands use only the list number in
the stack. Changing this will break backward compatibility. We can
add support for changing the current entry in a list using the
setqflist() function.
Can you try the attached patch which extends the setqflist() and
setloclist() functions to set the index of the current entry in a
quickfix/location list?
Thanks,
Yegappan
|
I've reviewed #3701, but not really tried it - looks good! As for 1.:
That sounds like a good solution. |
Hi,
On Thu, Dec 20, 2018 at 10:30 PM Daniel Hahler ***@***.***> wrote:
I've reviewed #3701, but not really tried it - looks good!
This has been merged now. Can you try the latest version of Vim?
- Yegappan
|
Thank you. |
Hi,
On Thu, Dec 20, 2018 at 10:30 PM Daniel Hahler ***@***.***> wrote:
I've reviewed #3701, but not really tried it - looks good!
As for 1.:
Can we extend the :chistory command to take a list number
in the stack?
That sounds like a good solution.
This has now been merged in 8.1.1281.
8ffc7c8
- Yegappan
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently there appears to be only
:colder
/:cnewer
to select a quickfix list, which uses relative counts (by number), and therefore it is not trivial to select a specific number (that you can get usinggetqflist({'id': qfid, 'nr': 1})
, but you would have to get the current number and then do a relative:colder
/:cnewer
. I think it would be nice being able to select a specific list by id. Not sure if selection by number is useful, because this might rotate (there are only 10).My use case / idea is to temporarily switch the lists for
:cc
/:ll
(wrapped by a command to go to nearest entries according to the cursor position).For this specific use case it would be best if temporarily switching the current list would not be necessary in the first place, i.e. it would be good if
:cc
/:ll
could be called on a non-current list - likely done best through a new function?! - but maybe also:[id]cc [count]
could be used?!This way plugins could go to next/prev/specific entries from their list, which must not be the one currently being displayed in the quickfix window.
The text was updated successfully, but these errors were encountered: