Skip to content

max completions box height #466

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

Closed
thomasballinger opened this issue Jan 25, 2015 · 6 comments
Closed

max completions box height #466

thomasballinger opened this issue Jan 25, 2015 · 6 comments

Comments

@thomasballinger
Copy link
Member

So that a full suggestions box doesn't move the current line to the very top of the screen, there should be a max height to the suggestions box. Could be a config value or a default if we can agree on one.

@thomasballinger
Copy link
Member Author

If bpython knew how much space it could use freely without scrolling the display it could make this decision more intelligently, but currently it has no knowledge of this. Scrolling of the info box would be another way to make this not a reduction in functionality.

@thomasballinger
Copy link
Member Author

There's a branch that tries out some of these ideas in the make-room branch https://github.com/bpython/bpython/compare/make-room

  • on bpython start, preemptively scroll down 10 lines
  • never scroll down more than 4 lines to show the info box (which gives it two lines of content minimum)
  • prefer displaying below the cursor unless that would cause scroll down - then if list_above config option is set, put info box above.

@thomasballinger
Copy link
Member Author

TODO: Try this out for a bit, make sure it works for small terminal sizes, ask @Julian or me what we think, update the branch to merge cleanly.

@thomasballinger
Copy link
Member Author

thomasballinger commented Jun 6, 2016

This is merged and works alright unless the terminal is very tiny. It would be nice to make the minimum_possible_height to a much smaller value for these cases - when the screen is less than 20 tall it's impossible to have more than one line of code onscreen at once.

@thomasballinger
Copy link
Member Author

I'd like to change it to 4, which means that when code is at the bottom of the screen only two lines of completions will be visible. I hope this is ok because one can hit ctrl-l to move the current line to the top to view more, but it would be nice to have another parameter for how many lines are visible; 4 should only become relevant for very small terminal dimensions.

@thomasballinger
Copy link
Member Author

I propose a new system:

  • Try to preserve n lines of history (try_preserve_history_height)
  • unless that space is needed to make the completion box m lines (minimum_possible_height)
  • but if there's space in the terminal below the cursor to fill, go ahead and fill it.

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

No branches or pull requests

1 participant