summaryrefslogtreecommitdiff
path: root/src/normal.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/normal.zig')
-rw-r--r--src/normal.zig15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/normal.zig b/src/normal.zig
index 8b1cf545..6b9508f8 100644
--- a/src/normal.zig
+++ b/src/normal.zig
@@ -57,7 +57,7 @@ fn startSelRegex(p: *Pardes, pane: *Pane, t: *Text, mode: modal.Normal.RegexMode
const got = t.ranges(text, 0, &pane.sel_snap);
pane.nsel_snap = @intCast(got.n);
pane.sel_snap_pri = @intCast(got.pri);
- pane.sel_snap_expl = (t.vsel.active and t.vsel.explicit) or t.msel.active;
+ pane.sel_snap_expl = t.vsel.active and t.vsel.explicit;
p.startPrompt(pane, t, .{ .search = regexMarker(mode) });
}
@@ -346,7 +346,7 @@ pub fn nodeSelect(p: *Pardes, pane: *Pane, t: *Text, walk: modal.Normal.NodeWalk
const f = if (pane.file) |*file| file else return;
const tree = fileTree(p, f) orelse return;
const text = f.content;
- const expl = (t.vsel.active and t.vsel.explicit) or t.msel.active;
+ const expl = t.vsel.active and t.vsel.explicit;
const arena = p.scratch.allocator();
const rs = arena.alloc(modal.Selection, Text.max_selections) catch return;
const got = t.ranges(text, 0, rs[0..Text.max_selections]);
@@ -545,7 +545,6 @@ pub fn replaySels(p: *Pardes, t: *Text, what: Replay) void {
.col = list[i].acol,
.explicit = explicit,
};
- t.msel.active = false;
t.sticky_col = list[i].sticky;
switch (what) {
.normal => |normal_action| executeNormalAction(p, t, normal_action),
@@ -612,8 +611,8 @@ fn executeNormalAction(p: *Pardes, t: *Text, a: modal.Normal.Action) void {
// acts for the pane the text belongs to; a header's is the active one.
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 })) {
+ const before = .{ t.cur_row, t.cur_col, t.vsel, t.select, t.nsel, t.mode };
+ defer if (raw_selection and !std.meta.eql(before, .{ t.cur_row, t.cur_col, t.vsel, t.select, t.nsel, t.mode })) {
pane.clearPointerSelection(sel_slot);
pane.sel[sel_slot].state = .none;
};
@@ -773,9 +772,7 @@ fn executeNormalAction(p: *Pardes, t: *Text, a: modal.Normal.Action) void {
t.select = false;
} else {
t.select = true;
- if (t.msel.active) {
- t.setRange(text, 0, range, true);
- } else if (!t.vsel.active) {
+ if (!t.vsel.active) {
t.vsel = .{ .active = true, .row = t.cur_row, .col = t.cur_col, .explicit = true };
} else {
t.vsel.explicit = true;
@@ -788,7 +785,7 @@ fn executeNormalAction(p: *Pardes, t: *Text, a: modal.Normal.Action) void {
.shrink_to_line_bounds => return t.shrinkSelToLineBounds(text, range),
.collapse_selection => return t.setRange(text, 0, .{ .anchor = cur, .head = cur }, false),
.flip_selection => {
- const explicit = (t.vsel.active and t.vsel.explicit) or t.msel.active;
+ const explicit = t.vsel.active and t.vsel.explicit;
return t.setRange(text, 0, .{ .anchor = range.head, .head = range.anchor }, explicit);
},
.select_all => return t.setRange(text, 0, .{ .anchor = 0, .head = text.len }, false),