feat: make hover_time configurable

This commit is contained in:
CJ van den Berg 2025-08-04 10:55:33 +02:00
parent 032eb30c45
commit dc69e8a456
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 2 additions and 1 deletions

View file

@ -17,6 +17,7 @@ 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

View file

@ -6159,7 +6159,7 @@ pub const EditorWidget = struct {
}
if (event == .init) {
self.hover_mouse_event = false;
const delay_us: u64 = std.time.us_per_ms * 500;
const delay_us: u64 = std.time.us_per_ms * tui.config().hover_time_ms;
self.hover_timer = tp.self_pid().delay_send_cancellable(self.editor.allocator, "editor.hover_timer", delay_us, .{"HOVER"}) catch null;
}
}