From f1025c18a78c02ebf157f0e3a5d9552605c082e8 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 27 Sep 2026 22:13:34 -0300 Subject: Move helix normal mode out of pardes.zig into normal.zig Pure move, no behaviour change: the key-to-role matching (isPrefix, roleBindingName, normalInput), multiOnce, the selection regex prompt (startSelRegex, selRegexArmed, applySelRegex), KeyState, Replay and replaySels, handleNormal, executeNormalAction and handlePdfNormal, with two tests, go verbatim to normal.zig. The methods become free functions taking `p: *Pardes`; their 22 call sites (handleKey, the mouse, look walk, lsp, runBuiltin, body drawing and edit.zig) change from `p.handleNormal(..)` to `normal.handleNormal(p, ..)`. test/lspbench.zig's second anchor follows its needle into src/normal.zig. Co-Authored-By: Claude Opus 5.5 --- src/body_layer.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/body_layer.zig') diff --git a/src/body_layer.zig b/src/body_layer.zig index 8c345b97..6bac7018 100644 --- a/src/body_layer.zig +++ b/src/body_layer.zig @@ -5,6 +5,7 @@ //! and cursor. const std = @import("std"); const pardes = @import("pardes.zig"); +const normal = @import("normal.zig"); const edit = @import("edit.zig"); const config = @import("config.zig"); const limits = @import("memory.zig").limits; @@ -386,7 +387,7 @@ pub fn renderBody(p: *Pardes, arena: std.mem.Allocator, pane: *Pane, r: Rect, id } } } - const preview = Pardes.selRegexArmed(pane) != null; + const preview = normal.selRegexArmed(pane) != null; const show_prim = (pane.mode == .normal and pane.vsel.active) or preview or (modal_hover and pane.vsel.active); const show_extra = pane.mode != .tty and pane.nsel > 0; -- cgit v1.3