-
-
Notifications
You must be signed in to change notification settings - Fork 657
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
feat: add focus attribute in layout #958
Conversation
That's exactly what I need. +1 |
If it passes CI and @jaeheonji thinks it's good, I'm happy. |
@djpate Thanks for your interest! @imsnif The original concept for this feature was presented by @a-kenji, so I respect his opinion and await a review. As an aside, I'm currently busy until this week, so please be patient if the work is a little late 🙏 |
@jaeheonji - there is no rush! Please take your time. |
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.
Sorry that it took this long.
This is awesome!
LGTM!
* change the instruction name for focus-on-tab
History Note: I did not fully implement the function I initially expected. In particular, the ability to save the state of the focused (Because I found a conflict with the multiple user function and an unexpected bug internally. This should be managed as a separate issue.) So, I only implement focusing on specific |
This PR resolve #852 , resolve #942
Description
The
focus
attribute is added to the layout like this:First, each
TabLayout
has afocus
attribute. The focus value of the top-level TabLayout determines "whichtab
to focus on."The sub-level TabLayout refers to the
pane
of each tab, it determines "whichpane
to focus on".If focus attribute is duplicated, tab or pane with the first declared value is focused.
Also, to keep the state of the last focused pane within each tab, the
Tab
struct has alast_active_pane_id
variable.This saves the state of the focused pane from the layout, and at the same time preserves the state of the previous pane when the tab is moved. (Previously, it was initialized to the first (Index 0) pane)
I declared the
last_active_pane_id
variable as anOption
in case there was any problem with the system. If it's no problem, I will remove theOption
type.Other thing..
To focus the tab, internally call
GoToTab
Instruction after all layouts are loaded.When zellij starts with multiple tabs layout, it currently has the following process.
Of course, this is not a big problem but,
It might be a good idea to render only once, only when the program is started. Of course this is a different issue.
EDIT: I will update the test-related errors when this feature is determined to be ok.