summaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2018-06-09 14:06:16 +0200
committerBert Münnich <ber.t@posteo.de>2018-06-09 14:07:13 +0200
commit1de5f06f83408243211ba7872a15324fec7e3e01 (patch)
treecec24e61f671883b12ddfb44f4e60478c149f311 /commands.c
parent5367b75867ccee99dcc5730bf04e3f3b10b4138d (diff)
downloadnsxiv-1de5f06f83408243211ba7872a15324fec7e3e01.tar.zst
Set global markidx whenever a single img is (un)marked
This also sets *markidx* when using the right mouse button in thumbnail mode.
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/commands.c b/commands.c
index 7c00028..d2917bb 100644
--- a/commands.c
+++ b/commands.c
@@ -194,7 +194,6 @@ bool cg_zoom(arg_t d)
bool cg_toggle_image_mark(arg_t _)
{
- markidx = fileidx;
return mark_image(fileidx, !(files[fileidx].flags & FF_MARK));
}
@@ -213,11 +212,11 @@ bool cg_reverse_marks(arg_t _)
bool cg_mark_range(arg_t _)
{
- int i, d = fileidx < markidx ? 1 : -1;
+ int d = markidx < fileidx ? 1 : -1;
bool dirty = false, on = !!(files[markidx].flags & FF_MARK);
- for (i = fileidx; i != markidx; i += d) {
- if (mark_image(i, on))
+ while (markidx != fileidx) {
+ if (mark_image(markidx + d, on))
dirty = true;
}
return dirty;