Repository navigation
fix #466 - don't fill whole screen with completions - #585
thomasballinger wants to merge 0 commit into
Conversation
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Is this is the sort of thing you're thinking of? https://github.com/bpython/bpython/compare/inheritance-over-composition
There was a problem hiding this comment.
Yes, something like that.
9f3d131 to
d2112a2
Compare
Thoughts?
I'm also going to look at making the infobox suggestions scroll.