]> git.lyx.org Git - lyx.git/commitdiff
Fix crash when deleting inset with backspace
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 7 Apr 2024 17:23:12 +0000 (19:23 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 7 Apr 2024 17:29:53 +0000 (19:29 +0200)
See description here:
https://marc.info/?l=lyx-devel&m=171243435229412&w=2

cutSelectionHelper did not request a metrics update when the selection
was inner to a paragraph. The new code is better, but it was not
necessary before the biginset branch because of a full metrics
computation that hid this missing case.

src/CutAndPaste.cpp

index 276285dfbc2dbcf3db0d10f59e991ffe23a2eb4e..abed1567d7fa289520784322cba948e8f0367b88 100644 (file)
@@ -989,6 +989,8 @@ void cutSelectionHelper(Cursor & cur, CutStack & cuts, bool realcut, bool putcli
 
                if (begpit != endpit)
                        cur.screenUpdateFlags(Update::Force | Update::FitCursor);
+               else
+                       cur.screenUpdateFlags(Update::SinglePar | Update::FitCursor);
 
                tie(endpit, endpos) =
                        eraseSelectionHelper(bp, text->paragraphs(), begpit, endpit,