Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor Pane somewhat according to
// FIXME: Use a struct that has a pane_type enum, to reduce all of the duplication
zellij/zellij-server/src/tab/mod.rs
Line 206 in 1dbd14f
As of now I've added a enum (
Pane
) which holds either a TerminalPane, or a PluginPane, and derefs to thePaneTrait
(previously justPane
) trait.Things I need to know:
PaneTrait
trait to move toPluginPane
andTerminalPane
respectivelyzellij-server/src/panes/mod.rs
is an acceptable (new) home for both thePane
enum and thePaneTrait
trait (PaneTrait
seems kind of out of place inzellij-server/src/tab/mod.rs
)PaneTrait
to something better (and what)Other Ideas and suggestions are more than welcome
Regarding the methods that should be moved
Here is a quick list of methods that I think might be better off outside of
PaneTrait
:Methods that I might be better off in
TerminalPane
zellij/zellij-server/src/tab/mod.rs
Line 483 in 1dbd14f
zellij/zellij-server/src/tab/mod.rs
Line 486 in 1dbd14f
zellij/zellij-server/src/tab/mod.rs
Line 493 in 1dbd14f
Methods that might be better off in
PluginPane
zellij/zellij-server/src/tab/mod.rs
Lines 475 to 477 in 1dbd14f
Q&A
Q: Why make this Draft instead of just coding away?
A: Because I prefer gathering info and tips before doing a somewhat huge amount of changes over having to scrap 90% of my code because it doesnt conform to the general vision of the Maintainers
Q: Why this?
A: Because Im currently working on another (smaller) change, and I dont want to have to write Spagetti Code to make it work. And Im sure the Maintainer(s) dont want me to either.