summaryrefslogtreecommitdiff
path: root/src/normal.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/normal.zig')
-rw-r--r--src/normal.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/normal.zig b/src/normal.zig
index 29d6d620..c7e75d70 100644
--- a/src/normal.zig
+++ b/src/normal.zig
@@ -175,7 +175,7 @@ const Replay = union(enum) {
pub fn replaySels(p: *Pardes, t: *Text, what: Replay) void {
const id = p.active;
// a header belongs to no pane and cannot go away under the replay
- const owner: ?*Pane = if (t.what == .column or t.what == .workspace) null else t.pane();
+ const owner = t.pane();
const serial = if (owner) |pane| pane.serial else 0;
// the whole selection in text coordinates, document order. t.sels
// is already ordered, so this only slots the primary into place.
@@ -292,7 +292,7 @@ pub fn handleNormal(p: *Pardes, t: *Text, key: Key) void {
fn executeNormalAction(p: *Pardes, t: *Text, semantic: modal.Normal.Action) void {
// What reaches past the text -- a builtin, a search, a language query --
// acts for the pane the text belongs to; a header's is the active one.
- const pane = if (t.what == .column or t.what == .workspace) p.panes[p.active] orelse return else t.pane();
+ const pane = t.pane() orelse p.panes[p.active] orelse return;
const raw_selection = t.what == .body and pane.rawPointerText(pane.sel[sel_slot]) != null;
const before = .{ t.cur_row, t.cur_col, t.vsel, t.msel, t.select, t.nsel, t.mode };
defer if (raw_selection and !std.meta.eql(before, .{ t.cur_row, t.cur_col, t.vsel, t.msel, t.select, t.nsel, t.mode })) {