-
Notifications
You must be signed in to change notification settings - Fork 179
fix: adjust cursor start position for large buffers #900
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
Conversation
Thanks for trying to make nushell and reedline better. Please help me understand how this fixes the issue. If my screen height is 50 how is queuing 50 |
Since reedline uses crossterm and crossterm uses ansi escape sequences to implement the function, I can use nushell to emulate the behavior.
|
But don't you have a bunch of empty lines after the buffer? |
The demo does have, but the nushell I compiled after patching not. |
7e611f1
to
af8a02e
Compare
I was experiencing this issue but I wasn't sure if it was caused by my terminal emulator or nushell/reedline. Thank you for working on this! |
Thanks! |
for _ in 0..screen_height - lines.required_lines(screen_width, None) { | ||
self.stdout.queue(Print(&coerce_crlf("\n")))?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed what I consider to be a proper fix to #898 (since there might be a value useful for both issues), Please review that when you get time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blindFS sorry for the slow reply, your PR was already merged by the time i got the time to take a look so i just forgot about it.
Besides, I'm not sure whether we should take
lines.hint
into account here.
getting a multiline hint can similarly push text up, not taking that into account can cause lines to disappear as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getting a multiline hint can similarly push text up, not taking that into account can cause lines to disappear as well.
Say we have a large_buffer repaint caused by a long multiline hint, if we add the height of self.hint to lines.required_lines
, we'll end up not doing any scrolling. Is that expected behavior?
nushell/nushell#15436