aboutsummaryrefslogtreecommitdiff
path: root/sam.c
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2024-05-11 17:52:28 -0600
committerRandy Palamar <randy@rnpnr.xyz>2024-05-21 20:21:46 -0600
commit06d7681cfffbc3e982fe192db4190f124b2b0848 (patch)
treeaf1d349cdca3890ce0b616789f719121b254a98b /sam.c
parent4c2b2d8a100a67212134c1bb89fad39311fa441e (diff)
downloadvis-06d7681cfffbc3e982fe192db4190f124b2b0848.tar.gz
vis-06d7681cfffbc3e982fe192db4190f124b2b0848.tar.xz
make Selection unopaque
Diffstat (limited to 'sam.c')
-rw-r--r--sam.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sam.c b/sam.c
index ef39ff6..8b32240 100644
--- a/sam.c
+++ b/sam.c
@@ -1270,7 +1270,7 @@ enum SamError sam_cmd(Vis *vis, const char *s) {
if (c->sel) {
if (visual) {
view_selections_set(c->sel, &r);
- view_selections_anchor(c->sel, true);
+ c->sel->anchored = true;
} else {
if (memchr(c->data, '\n', c->len))
view_cursors_to(c->sel, r.start);
@@ -1281,7 +1281,7 @@ enum SamError sam_cmd(Vis *vis, const char *s) {
Selection *sel = view_selections_new(c->win->view, r.start);
if (sel) {
view_selections_set(sel, &r);
- view_selections_anchor(sel, true);
+ sel->anchored = true;
}
}
}
@@ -1295,12 +1295,12 @@ enum SamError sam_cmd(Vis *vis, const char *s) {
if (vis->win) {
if (primary_pos != EPOS && view_selection_disposed(vis->win->view))
- view_cursor_to(vis->win->view, primary_pos);
+ view_cursors_to(vis->win->view->selection, primary_pos);
view_selections_primary_set(view_selections(vis->win->view));
vis_jumplist_save(vis);
bool completed = true;
for (Selection *s = view_selections(vis->win->view); s; s = view_selections_next(s)) {
- if (view_selections_anchored(s)) {
+ if (s->anchored) {
completed = false;
break;
}
@@ -1572,7 +1572,7 @@ static bool cmd_print(Vis *vis, Win *win, Command *cmd, const char *argv[], Sele
return false;
if (range->start != range->end) {
view_selections_set(sel, range);
- view_selections_anchor(sel, true);
+ sel->anchored = true;
} else {
view_cursors_to(sel, range->start);
view_selection_clear(sel);