]> git.lyx.org Git - lyx.git/commitdiff
Update caret if needed when changing depth
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 30 Aug 2023 11:45:00 +0000 (13:45 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 30 Aug 2023 11:45:00 +0000 (13:45 +0200)
Fixes bug #12856.

src/Text.cpp
src/Text.h

index 3a8be769e4c2344d747f3fc5364ab25761f8598a..dcac8ffa4d0781b56e99263b0d65415d2bcb4fe6 100644 (file)
@@ -2648,7 +2648,7 @@ bool Text::changeDepthAllowed(Cursor const & cur, DEPTH_CHANGE type) const
 }
 
 
-void Text::changeDepth(Cursor const & cur, DEPTH_CHANGE type)
+void Text::changeDepth(Cursor & cur, DEPTH_CHANGE type)
 {
        LBUFERR(this == cur.text());
        pit_type const beg = cur.selBegin().pit();
@@ -2667,6 +2667,7 @@ void Text::changeDepth(Cursor const & cur, DEPTH_CHANGE type)
                }
                max_depth = par.getMaxDepthAfter();
        }
+       cur.setCurrentFont();
        // this handles the counter labels, and also fixes up
        // depth values for follow-on (child) paragraphs
        cur.forceBufferUpdate();
index 01d47d69662ffba9ff06d21103222d62a99e3473..45fb69c5be517ca2bcbe3d85353add72ad96370c 100644 (file)
@@ -94,7 +94,7 @@ public:
        };
        /// Increase or decrease the nesting depth of the selected paragraph(s)
        /// FIXME: replace Cursor with DocIterator.
-       void changeDepth(Cursor const & cur, DEPTH_CHANGE type);
+       void changeDepth(Cursor & cur, DEPTH_CHANGE type);
 
        /// Returns whether something would be changed by changeDepth
        /// FIXME: replace Cursor with DocIterator.