mgunyho / tere

Terminal file explorer
European Union Public License 1.2
1.68k stars 38 forks source link

PageUp/Down not work if in search mode #58

Open metasong opened 2 years ago

metasong commented 2 years ago

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 commented 2 years ago

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?

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.