Skip to content
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

Add b:qflisttype read-only variable #4550

Closed
blueyed opened this issue Apr 9, 2016 · 4 comments
Closed

Add b:qflisttype read-only variable #4550

blueyed opened this issue Apr 9, 2016 · 4 comments
Labels
enhancement feature request
Milestone

Comments

@blueyed
Copy link
Contributor

blueyed commented Apr 9, 2016

This is necessary to distinguish quickfix windows from location list windows.

There's an old patch on vim_dev (posted on 12/10/14 by @mattn): https://groups.google.com/d/msg/vim_dev/GIjn9QRyLag/M_8AJ5_UkMoJ / https://gist.github.com/mattn/6c8942fa063c2f3953bc.

The core change is quite tiny:

--- a/src/quickfix.c    Mon Dec 08 04:16:45 2014 +0100
+++ b/src/quickfix.c    Wed Dec 10 18:26:51 2014 +0900
@@ -2433,6 +2433,8 @@
        set_option_value((char_u *)"fdm", 0L, (char_u *)"manual",
                                   OPT_LOCAL);
 #endif
+       set_internal_string_var("b:qflisttype", (curwin->w_llist_ref
+                       == NULL) ? "quickfix" : "location");
    }

    /* Only set the height when still in the same tab page and there is no

It would be nice for plugins to have this information.
See the vim_dev thread for workarounds that are needed for this currently.

Similar to the title patch for setqflist it seems like this might not get into Vim for a while, so Neovim could go ahead in this case, too.

In the same direction it would be useful to have functions to get the quickfix window for a tab, and the location list for a window directly.

@justinmk
Copy link
Member

justinmk commented Apr 9, 2016

Rather that provide a b: variable, I would suggest providing this as part of #3933. E.g.:

echo winlayout()['loclist']

@blueyed
Copy link
Contributor Author

blueyed commented Jul 12, 2016

btw: this is provided through the vim-qf plugin in a smart way: in after/ftplugin/qf.vim b:isLoc gets set:
https://github.com/romainl/vim-qf/blob/54c18ae1d2b300868321e15c9867eee7cb0a0bad/after/ftplugin/qf.vim#L30

@justinmk justinmk added the enhancement feature request label Jul 12, 2016
@justinmk justinmk added this to the todo milestone Jul 12, 2016
@rafi
Copy link
Sponsor Contributor

rafi commented Jul 2, 2021

This could really improve qflist vs. loclist functionality, like toggling a specific list window visibility.

@justinmk
Copy link
Member

:help getqflist()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request
Projects
None yet
Development

No branches or pull requests

3 participants