Skip to content

fix #466 - don't fill whole screen with completions - #585

Closed
thomasballinger wants to merge 0 commit into
masterfrom
make-room
Closed

thomasballinger wants to merge 0 commit into
masterfrom
make-room

Conversation

@thomasballinger

Copy link
Copy Markdown
Member

Thoughts?

  • tune minimum info box size when some content is hidden (currently 30 lines)
  • decide whether premptively making some room is worthwhile (currently 6 lines)
  • test on small terminal sizes, make sure this doesn't make things less usable

I'm also going to look at making the infobox suggestions scroll.

Comment thread bpython/curtsies.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason all those functions do not have a default implementation in Repl and are overwritten in a derived class taking window and input_generator?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you point out, currently the Repl class doesn't have a handle on the Window object, all it has are callbacks for getting the information it needs.

You're suggesting a third class that inherits from the curtsiesfrontend.repl.Repl (which in turn inherits from the repl.Repl) that on instantiation is passed a window object and an input_generator (oh, or creating them itself would be better)? That sounds nice, I'm not sure why I did the callback style instead -- probably too much node.js and other less OOP programming recently. Also a little bit of anti-inheritance bias. I don't see a good reason not to though, in fact the base curtsies repl class could even be functional like the old embedded version, and would be nice for testing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be up for trying this refactor in a new branch, I'll open a PR early so it's easy to talk about it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking back the reason was probably the frustration of hopping back and forth between bpython/curtsiesfrontent/repl.py and bpython/repl.py and thinking that for poorly defined interfaces like this (dozens of methods on each, not really specced out what belonged where) that composition was easier to keep track of.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this is the sort of thing you're thinking of? https://github.com/bpython/bpython/compare/inheritance-over-composition

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, something like that.

@thomasballinger thomasballinger changed the title WIP fix #466 - don't fill whole screen with completions fix #466 - don't fill whole screen with completions Dec 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants