From: Jean-Marc Lasgouttes Date: Wed, 30 Aug 2023 11:45:00 +0000 (+0200) Subject: Update caret if needed when changing depth X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0912f7c35636443ecb7cc419ac7cd118c2b91ca8;p=features.git Update caret if needed when changing depth Fixes bug #12856. --- diff --git a/src/Text.cpp b/src/Text.cpp index 3a8be769e4..dcac8ffa4d 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -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(); diff --git a/src/Text.h b/src/Text.h index 01d47d6966..45fb69c5be 100644 --- a/src/Text.h +++ b/src/Text.h @@ -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.