diff options
author | Jae-Heon Ji <32578710+jaeheonji@users.noreply.github.com> | 2022-06-18 09:58:42 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-18 09:58:42 +0900 |
commit | 8e2be2c61e79a0c59a0b03f62f40da1f296b9f2c (patch) | |
tree | 622c89f399dd9d1a8fd0578cf2f8982030f5b6c9 /zellij-server/src/panes/plugin_pane.rs | |
parent | 8da620784931871fa85ad7ec1fb4cc655d442ebd (diff) |
feat: add action to undo rename (#1513)
Diffstat (limited to 'zellij-server/src/panes/plugin_pane.rs')
-rw-r--r-- | zellij-server/src/panes/plugin_pane.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/zellij-server/src/panes/plugin_pane.rs b/zellij-server/src/panes/plugin_pane.rs index a4f8cacd5..56b252be0 100644 --- a/zellij-server/src/panes/plugin_pane.rs +++ b/zellij-server/src/panes/plugin_pane.rs @@ -30,6 +30,7 @@ pub(crate) struct PluginPane { pub active_at: Instant, pub pane_title: String, pub pane_name: String, + prev_pane_name: String, frame: bool, borderless: bool, } @@ -54,7 +55,8 @@ impl PluginPane { content_offset: Offset::default(), pane_title: title, borderless: false, - pane_name, + pane_name: pane_name.clone(), + prev_pane_name: pane_name, } } } @@ -386,6 +388,18 @@ impl Pane for PluginPane { fn set_content_offset(&mut self, offset: Offset) { self.content_offset = offset; } + + fn store_pane_name(&mut self) { + if self.pane_name != self.prev_pane_name { + self.prev_pane_name = self.pane_name.clone() + } + } + fn load_pane_name(&mut self) { + if self.pane_name != self.prev_pane_name { + self.pane_name = self.prev_pane_name.clone() + } + } + fn set_borderless(&mut self, borderless: bool) { self.borderless = borderless; } |