]> git.lyx.org Git - lyx.git/commitdiff
* up/down jumps between macro parameters
authorStefan Schimanski <sts@lyx.org>
Thu, 14 Jun 2007 20:57:56 +0000 (20:57 +0000)
committerStefan Schimanski <sts@lyx.org>
Thu, 14 Jun 2007 20:57:56 +0000 (20:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18774 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/MathMacro.cpp
src/mathed/MathMacro.h

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);
index 6193ec62febe70403c10a28fc4833e7acb52aea8..8e9f1b23d051560462e892d7340cc94058b988a7 100644 (file)
@@ -48,6 +48,8 @@ public:
        /// target pos when we enter the inset from the right by pressing "Left"
        bool idxLast(Cursor &) const;
        ///
+       bool idxUpDown(Cursor & cur, bool up) const;
+       ///
        virtual bool notifyCursorLeaves(Cursor &);
        ///
        docstring name() const;