[LyX features/biginset] Fix crash when deleting inset with backspace

Jean-Marc Lasgouttes lasgouttes at lyx.org
Sun Apr 7 18:42:24 UTC 2024


commit b9e7754c932b014e019534f8e7aaf46797537e64
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Sun Apr 7 19:23:12 2024 +0200

    Fix crash when deleting inset with backspace
    
    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.
    
    (cherry picked from commit 89901123c579c6c7dbd1aecd092d62c3a0a3db24)
---
 src/CutAndPaste.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index 7fd76f98bc..09978d7c50 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -984,6 +984,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,


More information about the lyx-cvs mailing list