]> git.lyx.org Git - lyx.git/commitdiff
outline-up/down: preserve cursor's position
authorScott Kostyshak <skostysh@lyx.org>
Wed, 11 Mar 2020 18:18:33 +0000 (14:18 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Wed, 11 Mar 2020 18:19:05 +0000 (14:19 -0400)
There is no need to change the cursor's position to the beginning of
the line.

This change does not affect the behavior of using the buttons in the
Outliner pane, but is useful for using the keyboard shortcuts.

src/Text3.cpp

index 81b01324ada93af26b28c9fb5e6dec79a0ada8da..4a4755637a9b0fe226e0f142efdeb70ffed20d9e 100644 (file)
@@ -2765,14 +2765,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
 
        case LFUN_OUTLINE_UP:
                outline(OutlineUp, cur, this);
-               setCursor(cur, cur.pit(), 0);
+               setCursor(cur, cur.pit(), cur.pos());
                cur.forceBufferUpdate();
                needsUpdate = true;
                break;
 
        case LFUN_OUTLINE_DOWN:
                outline(OutlineDown, cur, this);
-               setCursor(cur, cur.pit(), 0);
+               setCursor(cur, cur.pit(), cur.pos());
                cur.forceBufferUpdate();
                needsUpdate = true;
                break;