From 2ca613c5a62cbc5ba20b1ba957bd57328862dfa8 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 14 Jan 2026 12:04:20 +0100 Subject: [PATCH] feat: add cancel action to idle_actions --- src/config.zig | 1 + src/tui/editor.zig | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/config.zig b/src/config.zig index c16ee16..a492272 100644 --- a/src/config.zig +++ b/src/config.zig @@ -79,6 +79,7 @@ const default_actions = [_]IdleAction{}; pub const IdleAction = enum { hover, highlight_references, + cancel, }; pub const DigitStyle = enum { diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 34fa63b..b26e323 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -6928,6 +6928,10 @@ pub const EditorWidget = struct { try self.editor.hover_at_abs(@intCast(self.hover_y), @intCast(self.hover_x)); } else if (try m.match(.{"input_idle"})) { for (tui.config().idle_actions) |action| switch (action) { + .cancel => { + self.editor.cancel_all_matches(); + tui.need_render(); + }, .hover => { try self.editor.hover(.{}); },