-
Notifications
You must be signed in to change notification settings - Fork 144
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
Handle selection items overflowing several times #190
base: master
Are you sure you want to change the base?
Conversation
Handle multi-line items in sort and fuzzy_select. Select and multi-select already handle these.
The previous code would (correctly) handle the case of an item spanning between one and two lines, but failed to consider the case of the output spanning more than two. Extend the logic to cover that.
Record the logic of the commit which introduced it. The current logic is not quite correct; we'll fix that in the next commits.
…rompts. Formatting each item adds two additional characters, which the code forgot to take into account.
There's a deeper issue underlying this: for any output line which overflows the terminal (i.e. is longer than the terminal width), we only increase the height by one --- even if the line can span several lines on the terminal. When clearing the terminal, we only take the height into account, i.e. will not clear enough output. A deeper fix would be to record the length of each line of output, and take this into account when clearing the terminal. (I have prototyped this; it seems workable, if slightly fiddly.) Counter-arguments I can think of
@psunkara (or other maintainers). Would you prefer to see a "more right" fix instead? |
In #104 @pksunkara mentioned I believe, with |
Looks like it. |
PR #14 was good, but not general enough: there were in fact two different bugs hiding. This PR
See individual commits for details.