-
Notifications
You must be signed in to change notification settings - Fork 177
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
bug v3: Order of entries changes, when jumping to next entry in a trouble telescope or quickfix list #399
Comments
Started to migrate to v3, experiencing the same issue |
That's actually because of the default sort for some sources. This is the default for sort = { { buf = 0 }, "severity", "filename", "pos", "message" }, The first item of the sorter will sort items from your current buffer to the top. You can change it with: {
modes = {
diagnostics = {
sort = { "severity", "filename", "pos", "message" },
}
}
} I'll keep this issue open for now, since the default doesn't work well indeed for going to next/previous items |
And |
would it make sense then to make the following defaults? modes = {
telescope = {
sort = { "pos", "filename", "severity", "message" },
},
quickfix = {
sort = { "pos", "filename", "severity", "message" },
},
loclist = {
sort = { "pos", "filename", "severity", "message" },
},
todo = {
sort = { "pos", "filename", "severity", "message"}
},
} I guess it makes sense for diagnostics that they sort every time you move or jump inside the list, since fixing lsp errors is a continuous task. But for quickfix, loclist, todo comments (which have imho no severity?) and telescope results its quite confusing when the order changes every time you move |
Changed all the views to remove the |
What was the default sort behavior in the old version of trouble? My workflow is the following:
in the old version of trouble, the order was preserverd. it behaved just like the native vim qflist. how must i configure the sorter, so the order is not changed, even after closing and opening trouble again? |
@tummetott seems I forgot to remove that |
Or maybe in other words. How can i preserve the order that telescope shows me after typing a query? When sending items of a telescope search to a native qflist, the order is the one from telescope. in trouble, i can sort by filetype (which is the behavior of the old trouble) or by |
You can try You'll probaly also have to set |
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.9.5 Build type: Release LuaJIT 2.1.1703358377
Operating system/version
MacOs 14.2.1
Describe the bug
Lets say I have the 4 files
a
b
c
,d
opened in a trouble window (e.g. from Telescope from a Quickfix list, it does not matter).When I execute
:lua require'trouble'.next({jump=true})
a few times, the order of the trouble list changes.Steps To Reproduce
mkdir test && cd test
touch a b c d
nvim -u path/to/repro.lua
:Telescope find_files
<C-q>
to open all files in a trouble window:lua require'trouble'.next({jump=true})
:lua require'trouble'.next({jump=true})
--> The order is already messed up
this also happens with quickfix lists.
BTW: what is the difference between
:Trouble qflist
and:Trouble quickfix
?? i can open two trouble windows, showing the same content?Expected Behavior
Order should not change.
Repro
The text was updated successfully, but these errors were encountered: