From 16701f61b48ab54d00a52de08b7685fa6304b914 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 11 Apr 2021 16:10:14 -0700 Subject: [PATCH] fix new-tab hover calculation refs: https://github.com/wez/wezterm/issues/677 --- wezterm-gui/src/tabbar.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wezterm-gui/src/tabbar.rs b/wezterm-gui/src/tabbar.rs index 52eb39033..beedbbdd8 100644 --- a/wezterm-gui/src/tabbar.rs +++ b/wezterm-gui/src/tabbar.rs @@ -222,7 +222,10 @@ impl TabBarState { // New tab button { let hover = mouse_x - .map(|mouse_x| mouse_x >= x && mouse_x < x + 3) + .map(|mouse_x| { + mouse_x >= x + && mouse_x < x + new_tab_hover_left.len() + new_tab_hover_right.len() + 1 + }) .unwrap_or(false); let (cell_attrs, left, right) = if hover {