diff --git a/src/config.zig b/src/config.zig index f2a65e6..7436e84 100644 --- a/src/config.zig +++ b/src/config.zig @@ -17,7 +17,6 @@ whitespace_mode: []const u8 = "none", inline_diagnostics: bool = true, animation_min_lag: usize = 0, //milliseconds animation_max_lag: usize = 50, //milliseconds -hover_time_ms: usize = 500, //milliseconds enable_format_on_save: bool = false, restore_last_cursor_position: bool = true, follow_cursor_on_buffer_switch: bool = false, //scroll cursor into view on buffer switch diff --git a/src/tui/editor.zig b/src/tui/editor.zig index f6943c7..e432ab8 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -6043,7 +6043,6 @@ pub const EditorWidget = struct { hover_timer: ?tp.Cancellable = null, hover_x: c_int = -1, hover_y: c_int = -1, - hover_mouse_event: bool = false, const Self = @This(); const Commands = command.Collection(Editor); @@ -6110,10 +6109,8 @@ pub const EditorWidget = struct { const hover_y, const hover_x = self.editor.plane.abs_yx_to_rel(y, x); if (hover_y != self.hover_y or hover_x != self.hover_x) { self.hover_y, self.hover_x = .{ hover_y, hover_x }; - if (self.editor.jump_mode) { + if (self.editor.jump_mode) self.update_hover_timer(.init); - self.hover_mouse_event = true; - } } } else if (try m.match(.{ "B", tp.extract(&event), tp.extract(&btn), tp.any, tp.extract(&x), tp.extract(&y), tp.extract(&xpx), tp.extract(&ypx) })) { try self.mouse_click_event(event, @enumFromInt(btn), y, x, ypx, xpx); @@ -6141,7 +6138,7 @@ pub const EditorWidget = struct { } } else if (try m.match(.{"HOVER"})) { self.update_hover_timer(.fired); - if (self.hover_y >= 0 and self.hover_x >= 0 and self.hover_mouse_event) + if (self.hover_y >= 0 and self.hover_x >= 0) try self.editor.hover_at_abs(@intCast(self.hover_y), @intCast(self.hover_x)); } else if (try m.match(.{ "whitespace_mode", tp.extract(&bytes) })) { self.editor.render_whitespace = Editor.from_whitespace_mode(bytes); @@ -6158,8 +6155,7 @@ pub const EditorWidget = struct { self.hover_timer = null; } if (event == .init) { - self.hover_mouse_event = false; - const delay_us: u64 = std.time.us_per_ms * tui.config().hover_time_ms; + const delay_us: u64 = std.time.us_per_ms * 100; self.hover_timer = tp.self_pid().delay_send_cancellable(self.editor.allocator, "editor.hover_timer", delay_us, .{"HOVER"}) catch null; } }