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

PageUp/Down not work if in search mode #58

Open
metasong opened this issue Sep 6, 2022 · 1 comment
Open

PageUp/Down not work if in search mode #58

metasong opened this issue Sep 6, 2022 · 1 comment

Comments

@metasong
Copy link

metasong commented Sep 6, 2022

convenient to find file/folder in gap-anywhere searching mode.

reproduce: type some chars in gap-anywhere mode in a large dir, then pageup/down

@mgunyho
Copy link
Owner

mgunyho commented Sep 7, 2022

I have thought about this a bit, and I agree that PageUp/Down should do something while searching. However, it's a bit tricky to figure out what that something should be.

Right now, the scroll position of the screen is closely tied to the cursor position. When you press PageUp/Down when not searching, the cursor just moves down by the height of the screen. But if you're searching, the cursor can (and should) only jump to items that match the search. So if you press PageDown, what should happen?

  • If the cursor moves to the next item that is outside the screen, we might scroll the view by just one position (if the cursor was at the bottom of the screen and there is an item right below it), which is not what you would expect when you press PageDown.
  • If the cursor moves down so that we have moved at least a screenful, we might miss some items completely, which is also a bit confusing.
  • What else could the logic be?

I'm not saying that this is impossible, but it will require quite a bit of thinking to get right, and a lot of tests in addition to the existing ones (note how there is one test of the scrolling that doesn't actually pass), because there are lots of edge cases.

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

No branches or pull requests

2 participants