aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
authorDaniel Jankowski <daniel.jankowski@rub.de>2024-10-05 17:19:41 +0200
committerDaniel Jankowski <daniel.jankowski@rub.de>2024-10-05 17:19:41 +0200
commit6d13e481aceacd3efe583fb6c442f30e8909f555 (patch)
tree6dd791834a35a4977bc6ce96a70fa589b805c990 /src/bin
parentchore: update cargo deps (diff)
downloadsl0pstatus-6d13e481aceacd3efe583fb6c442f30e8909f555.tar.gz
sl0pstatus-6d13e481aceacd3efe583fb6c442f30e8909f555.tar.xz
sl0pstatus-6d13e481aceacd3efe583fb6c442f30e8909f555.zip
feat: hide frames except on search
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/zjstatus.rs36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/bin/zjstatus.rs b/src/bin/zjstatus.rs
index ed7feb6..3ef57cc 100644
--- a/src/bin/zjstatus.rs
+++ b/src/bin/zjstatus.rs
@@ -199,14 +199,14 @@ impl State {
tracing::Span::current().record("event_type", "Event::PaneUpdate");
tracing::debug!(pane_count = ?pane_info.panes.len());
- if self.module_config.hide_frame_for_single_pane {
- frames::hide_frames_on_single_pane(
- self.state.tabs.clone(),
- &pane_info,
- &self.state.mode,
- get_plugin_ids(),
- );
- }
+ frames::hide_frames_conditionally(
+ self.module_config.hide_frame_for_single_pane,
+ self.module_config.hide_frame_except_for_search,
+ &self.state.tabs,
+ &pane_info,
+ &self.state.mode,
+ get_plugin_ids(),
+ );
self.state.panes = pane_info;
self.state.cache_mask = UpdateEventMask::Tab as u8;
@@ -254,17 +254,17 @@ impl State {
Event::SessionUpdate(session_info, _) => {
tracing::Span::current().record("event_type", "Event::SessionUpdate");
- if self.module_config.hide_frame_for_single_pane {
- let current_session = session_info.iter().find(|s| s.is_current_session);
+ let current_session = session_info.iter().find(|s| s.is_current_session);
- if let Some(current_session) = current_session {
- frames::hide_frames_on_single_pane(
- current_session.clone().tabs,
- &current_session.panes,
- &self.state.mode,
- get_plugin_ids(),
- );
- }
+ if let Some(current_session) = current_session {
+ frames::hide_frames_conditionally(
+ self.module_config.hide_frame_for_single_pane,
+ self.module_config.hide_frame_except_for_search,
+ &current_session.tabs,
+ &current_session.panes,
+ &self.state.mode,
+ get_plugin_ids(),
+ );
}
self.state.sessions = session_info;