summaryrefslogtreecommitdiffstats
path: root/default-plugins
diff options
context:
space:
mode:
authoramaihoefner <alexander.maihoefner@protonmail.com>2022-06-11 20:43:36 +0200
committerGitHub <noreply@github.com>2022-06-11 20:43:36 +0200
commitb19e3d9d143a4bb5b82956314d491060679c9085 (patch)
tree7faa4548119af058593dabcb01f21c3e90deb130 /default-plugins
parent0e897ba1564b5a67a001f37cd1ce9ff945a6e2e1 (diff)
fix: tab selection by left click in compact-bar (#1485)
Diffstat (limited to 'default-plugins')
-rw-r--r--default-plugins/compact-bar/src/main.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/default-plugins/compact-bar/src/main.rs b/default-plugins/compact-bar/src/main.rs
index cf85d5d9b..2d52a6f9d 100644
--- a/default-plugins/compact-bar/src/main.rs
+++ b/default-plugins/compact-bar/src/main.rs
@@ -115,11 +115,11 @@ impl ZellijPlugin for State {
if self.should_render
&& self.mouse_click_pos > len_cnt
&& self.mouse_click_pos <= len_cnt + bar_part.len
- && idx > 2
+ && idx > 3
{
- // First three elements of tab_line are "Zellij", session name and empty thing, hence the idx > 2 condition.
- // Tabs are indexed starting from 1, therefore we need subtract 2 below.
- switch_tab_to(TryInto::<u32>::try_into(idx).unwrap() - 2);
+ // First three elements of tab_line are "Zellij", session name and mode, hence the idx > 3 condition.
+ // Tabs are indexed starting from 1, therefore we need subtract 3 below.
+ switch_tab_to(TryInto::<u32>::try_into(idx).unwrap() - 3);
}
len_cnt += bar_part.len;
}