-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Improve pager wraparound #4680
Improve pager wraparound #4680
Conversation
This makes it possible to select the last element of the completions with just one keypress. Fixes fish-shell#3115.
Cool 👍 Does it work the same with
|
@laughedelic: Of course this is independent of the particular key - this modifies the pager's movement function, so any binding that calls any bind function that then moves the pager selection with one of the affected directions will be affected.
These are bound to "up-or-search"/"down-or-search" respectively, which are wrapper functions that call the "up-line"/"down-line" bind functions. So yes, they are fully affected.
These are bound to "complete" and "complete-and-search", which call the pager movement with "direction_next"/"direction_prev". They aren't affected, but there's nothing particularly wrong with them as far as I'm aware. |
OK. Thanks for clarifying! |
Since moving west no longer gets stuck in the top row (but instead wraps around to the bottom row), this needs to have some indices changed.
This needs some adjustment to the tests - I didn't notice that we had some in src/fish_tests.cpp (I always forget about that, and I don't think The first failure is moving "west". Let's say the pager looks like this:
(with [] denoting the cursor position on the and move "west"? Currently, this goes to So moving east or west just iterates in (western) reading-order - go through all the columns, then go to the next row and the starting column. Whereas now it does that, except it gets stuck in the last row. This makes it so that east/west reverse each other, which is a nice property. On the other hand, that "column memory" feature is now gone as far as I can tell. |
Description
This fixes a few cases where the pager didn't correctly wrap around.
It fixes #4669, in that moving down now also wraps around if the current selection is the last row in the last column. The same goes for moving "east" (e.g. via "forward-char") and "west" (e.g. via "backward-char").
It also fixes #3115, by allowing up to move into the pager if nothing is selected. So up from the first element will still jump into the commandline (which we might want to change, since it's the only way to do so), while up from the commandline will jump to the last element in the pager.
TODOs: