Skip to content

max completions box height #466

Closed
Closed

Description

@thomasballinger

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.

Activity

  1. thomasballinger commented on Feb 7, 2015

    @thomasballinger
    MemberAuthor

    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.

  2. thomasballinger commented on Feb 14, 2015

    @thomasballinger
    MemberAuthor

    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.
  3. thomasballinger commented on Apr 26, 2015

    @thomasballinger
    MemberAuthor

    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.

  4. thomasballinger commented on Jun 6, 2016

    @thomasballinger
    MemberAuthor

    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.

  5. thomasballinger commented on Jun 6, 2016

    @thomasballinger
    MemberAuthor

    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.

  6. thomasballinger commented on Jun 7, 2016

    @thomasballinger
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions