-
-
Notifications
You must be signed in to change notification settings - Fork 651
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
Toward enable should_render
(fix pane render)
#318
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @horasal - great work on this. I very much like this solution. Thanks for being patient with the review taking a bit longer than usual with the burst of attention this project received in the past week :)
Personally, I'm good to go forward with this. But I'd first like to understand the plan: are you interested in continuing the work on this? As I understand it, the main thing we have left is dealing with the implications of wide-characters on this. Do you have a plan to deal with them? I have some ideas otherwise... let me know if/how you'd like to continue. Then we can think if we'd like to have that change as part of this PR or not (eg. there are a few hacky ideas I can think of that can get us to uncomment the conditional in this PR and move forward).
@@ -656,6 +656,11 @@ impl Tab { | |||
pub fn toggle_fullscreen_is_active(&mut self) { | |||
self.fullscreen_is_active = !self.fullscreen_is_active; | |||
} | |||
pub fn set_force_render(&mut self) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I would have gone with something on the state of Tab
that bypasses the should_render
of each pane, but the more I think about it, the more I like this solution.
@@ -315,6 +316,7 @@ impl TerminalPane { | |||
let rows = self.get_rows(); | |||
let columns = self.get_columns(); | |||
self.grid.change_size(rows, columns); | |||
self.set_should_render(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elegant!
I did some experiments but still need many works and far from becoming a PR. (In current zellij,
It will be great if you can make zellij works with widechar! |
For sure making Zellij support wide characters is on the roadmap, but as you say this requires a bigger change.
A little hacky, but I think it's better than what we have now and will probably give us a performance boost until we can handle them properly. What do you think? |
It sounds good so I implemented it: https://github.com/horasal/zellij/tree/widechar_force_render |
Unfortunately, you're not missing anything - this happens in Since we don't support wide unicode characters yet, we don't properly detect them in order to line wrap inside a pane. So they end up being line-wrapped by the terminal emulator itself. This issue is super high priority for us to fix, and the only reason I didn't get to it myself yet is that there are other super high priority fixes on my plate before it :) That being said, I think it should not interfere with this PR... I'm happy you implemented this idea! Is it ready for a review? |
I agree with you. This pr should not be blocked by widechar problem. This is ready for a review. |
Hey, this is great! I'm good to go with this, but I would prefer to go with your solution of the wide characters and then uncomment the |
merge widechar_force_render, and uncomment |
Thank you very much for your work on this! |
This pr is the first step toward enable
should_render
, by fixing pane render when switching/resize tab.When
should_render
is enabled, pane won't be re-rendered unless its content is changed. When switching tab, panes in target tab may be not changed from its last render. Thus the render requests will be ignored and those panes' areas will mess up.This pr add a
set_force_render
toTab
, which will clear theshould_render
flag of panes belongs to this tab. Thentab::rander
call can rerender all panes.currently,
set_force_render
is called when:pane
should_render
will be true if