aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--commands.c7
-rw-r--r--main.c1
2 files changed, 4 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;
diff --git a/main.c b/main.c
index c6da126..1485246 100644
--- a/main.c
+++ b/main.c
@@ -323,6 +323,7 @@ void load_image(int new)
bool mark_image(int n, bool on)
{
+ markidx = n;
if (!!(files[n].flags & FF_MARK) != on) {
files[n].flags ^= FF_MARK;
markcnt += on ? 1 : -1;