aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-07-12 19:05:03 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-07-14 11:45:15 +0200
commit386eac2063bdda79279bbdea2fffcd7fc0ff682a (patch)
tree73ef16bc7f07ba8848020b98be3cde123f5b0a36 /main.c
parent546917d21ca10214c24d3871c92b81265de6958c (diff)
downloadvis-386eac2063bdda79279bbdea2fffcd7fc0ff682a.tar.gz
vis-386eac2063bdda79279bbdea2fffcd7fc0ff682a.tar.xz
vis-lua: make selection first class primitives in Lua API
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/main.c b/main.c
index c911c69..6c92715 100644
--- a/main.c
+++ b/main.c
@@ -1345,8 +1345,7 @@ static const char *selections_new(Vis *vis, const char *keys, const Arg *arg) {
}
if (sel_new) {
view_selections_primary_set(sel_new);
- if (anchored)
- view_selections_anchor(sel_new);
+ view_selections_anchor(sel_new, anchored);
}
}
vis_count_set(vis, VIS_COUNT_UNKNOWN);
@@ -1452,7 +1451,7 @@ static const char *selections_match_next(Vis *vis, const char *keys, const Arg *
size_t pos = text_char_prev(txt, word.end);
if ((s = view_selections_new(view, pos))) {
view_selections_set(s, &word);
- view_selections_anchor(s);
+ view_selections_anchor(s, true);
view_selections_primary_set(s);
goto out;
}
@@ -1465,7 +1464,7 @@ static const char *selections_match_next(Vis *vis, const char *keys, const Arg *
size_t pos = text_char_prev(txt, word.end);
if ((s = view_selections_new(view, pos))) {
view_selections_set(s, &word);
- view_selections_anchor(s);
+ view_selections_anchor(s, true);
view_selections_primary_set(s);
}