]> mj.ucw.cz Git - paperjam.git/commitdiff
Fixed selectors which walk pages backwards
authorMartin Mares <mj@ucw.cz>
Mon, 1 Jun 2020 09:51:11 +0000 (11:51 +0200)
committerMartin Mares <mj@ucw.cz>
Mon, 1 Jun 2020 09:51:11 +0000 (11:51 +0200)
cmds.cc

diff --git a/cmds.cc b/cmds.cc
index 7d0f9b659d934323bd02ef1b336c1811990867b6..7fad3028cccd0d462b3ba2d7cd72c7d258319c1a 100644 (file)
--- a/cmds.cc
+++ b/cmds.cc
@@ -580,7 +580,7 @@ vector<page *> select_cmd::process(vector<page *> &pages)
          int f = validate_page_index(pages, ps.from);
          int t = validate_page_index(pages, ps.to);
          int step = (f <= t) ? 1 : -1;
-         for (int i=f; i<=t; i += step)
+         for (int i=f; i != t + step; i += step)
            selected.push_back(pages[i]);
        }
       auto processed = run_command_list(pb->commands, selected);