-
Notifications
You must be signed in to change notification settings - Fork 168
Add smooth scrolling to menus #891
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
base: main
Are you sure you want to change the base?
Conversation
Here is a video of the new behavior, see issue above to see the current behavior demo.mp4 |
I'm really sorry, I'm having a hard time understanding what exactly this PR does from looking at the video, and when I run it myself (VS Code terminal, Windows Terminal + Zellij, Windows Terminal without Zellij), I don't see any change in behavior from the main branch. Is this supposed to keep the selected item at the top when scrolling? Edit: Okay, I was being dumb earlier. I thought "scrolling" meant scrolling in the terminal, not hitting the up arrow to move within the menu. Sorry about that, makes sense now. |
@ysthakur see the video linked in the original issue, basically currently when you scroll up, the selected item will be stuck at the bottom. |
ok i believe the PR should be ready now. I tested it with multiline prompts and with prompt wrapping (due to terminal size) The CI is failing because of the new rust lints added with 1.86, it would probably be better to fix them in another PR (although i can also fix them here if you want to) |
@sholderbach Could you take a look at this? I don't know Reedline well enough to say if the change to say if the
Yeah that's fine, no need to do it in this PR. With the change to This is how it looks currently without your change: So the new behavior actually looks more reasonable to me, since the prompt is visible. We do need to throw in an ANSI reset or something to fix that color, though. The only other place using reedline/src/painting/painter.rs Lines 230 to 231 in cc79605
Here, it hasn't drawn the prompt yet, so it doesn't want you to subtract the prompt height from the remaining lines. |
Ok so the prompt should now always be visible whenever a menu is open (so any content that is not fitting will get cut of at the end).
For me the colors are still the same (maybe check if that still happens with the latest commit)
Fixed that by re-adding the Edit: i believe it is ok to always subtract it from the |
PR currently breaks menu rendering with multiline prompts. 1: Current behavior -> menu has priority over prompt (prompt will be partially rendered if required) realistically people will probably at most use 2-3 line prompts, so option 2 is probably better for most cases but i believe i will try change it so we stick with the current behavior. |
With the latest commit, everything should be the same as before (apart from the scrolling)
not sure about the colors, but for me on both latest master, and latest commit on this PR the description menu (f1) so the prompt dissapearing seems to be "normal" behavior and is not caused by that (at least not by the latest commit) I did a good amount of testing and it works with So this PR should be ready now! |
currently when scrolling up, the selected item will always stick to the bottom (see #733)
This PR fixes that.
Currently implemented for
closes #733