]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathMacro.cpp
* up/down jumps between macro parameters
[lyx.git] / src / mathed / MathMacro.cpp
index a2dc9cea2d9ce8be630f2090e91149dad9f6ffa5..e40b958c45c4bac806e5b59939d56440bfc0c0cd 100644 (file)
@@ -254,6 +254,22 @@ bool MathMacro::idxLast(Cursor & cur) const
 }
 
 
+bool MathMacro::idxUpDown(Cursor & cur, bool up) const
+{
+       if (up) {
+               if (cur.idx() == 0)
+                       return false;
+               --cur.idx();
+       } else {
+               if (cur.idx() + 1 >= nargs())
+                       return false;
+               ++cur.idx();
+       }
+       cur.pos() = cell(cur.idx()).x2pos(cur.x_target());
+       return true;
+}
+
+
 bool MathMacro::notifyCursorLeaves(Cursor & cur)
 {
        cur.updateFlags(Update::Force);