summaryrefslogtreecommitdiff
path: root/src/edit.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/edit.zig')
-rw-r--r--src/edit.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/edit.zig b/src/edit.zig
index e44a3364..f829decc 100644
--- a/src/edit.zig
+++ b/src/edit.zig
@@ -3,6 +3,7 @@
//! operations, replace, case, join, indent, comments, numbers, textobjects
//! and surround, undo, yank and paste, and the pointer selections as text.
const pardes = @import("pardes.zig");
+const normal = @import("normal.zig");
const std = @import("std");
const modal = @import("modal.zig");
const panes = @import("panes.zig");
@@ -86,7 +87,7 @@ pub fn applyPaste(p: *Pardes, bytes: []const u8) void {
const range: @TypeOf(Pardes.tagSelBounds(pane)) = if (pane.tag_sel) Pardes.tagSelBounds(pane) else .{ .lo = pane.tag_col, .hi = pane.tag_col };
const hi = if (pane.tag_sel) modal.nextGrapheme(text, range.hi) else range.hi;
_ = p.replaceTagText(pane, range.lo, hi, bytes);
- if (Pardes.selRegexArmed(pane)) |a| p.applySelRegex(pane, a.pat, a.split);
+ if (normal.selRegexArmed(pane)) |a| normal.applySelRegex(p, pane, a.pat, a.split);
return;
}
if (pane.isTerminal() and pane.mode == .tty) return typeToTty(p, id, pane, bytes);
@@ -103,7 +104,7 @@ pub fn clipYank(p: *Pardes, pane: *Pane, main_only: bool) void {
return;
};
if (pane.nsel > 0 and !main_only) {
- p.replaySels(pane, .{ .normal = .{ .edit = .{ .kind = .yank, .count = 1 } } });
+ normal.replaySels(p, pane, .{ .normal = .{ .edit = .{ .kind = .yank, .count = 1 } } });
} else {
const others = pane.nsel;
pane.nsel = 0;
@@ -471,7 +472,7 @@ pub fn enterInsert(p: *Pardes, pane: *Pane, where: InsertAt, cnt: usize) void {
pub fn handleInsert(p: *Pardes, pane: *Pane, key: Key) void {
if (pane.nsel == 0) return insertKey(p, pane, key);
- p.replaySels(pane, .{ .insert = key });
+ normal.replaySels(p, pane, .{ .insert = key });
}
pub fn insertKey(p: *Pardes, pane: *Pane, key: Key) void {