feat: add configurable editor idle actions hover and highlight_references

closes #370
This commit is contained in:
CJ van den Berg 2025-11-07 13:37:07 +01:00
parent 06e967a69d
commit 6e78564599
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 18 additions and 2 deletions

View file

@ -6376,6 +6376,16 @@ pub const EditorWidget = struct {
self.update_hover_timer(.fired);
if (self.hover_y >= 0 and self.hover_x >= 0 and self.hover_mouse_event)
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) {
.hover => {
try self.editor.hover(.{});
},
.highlight_references => {
if (self.editor.cursels.items.len == 1 and self.editor.get_primary().selection == null)
try self.editor.highlight_references(.{});
},
};
} else if (try m.match(.{ "whitespace_mode", tp.extract(&bytes) })) {
self.editor.render_whitespace = Editor.from_whitespace_mode(bytes);
} else {