commit 5ca48a7a39e7211bf9f55487d8de38821c8613e6
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Fri Aug 30 16:56:16 2024 +0200

    Fix update of cursor in tab-delete when there is a selection
    
    The position of the cursor should not be decreased if it is already at
    the start of the paragraph. This can lead to a crash when trying to
    display the caret.
    
    (cherry picked from commit 16be88ca18719a98a555ced268431ca1040658b7)
---
 src/Text.cpp | 5 ++---
 status.24x   | 5 ++++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/Text.cpp b/src/Text.cpp
index 1e55600a80..e96c9a1e81 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -4594,10 +4594,9 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                        int const n = (c == ' ' ? 4 : 1);
                                        for (int i = 0; i < n
                                                  && !par.empty() && 
par.getChar(0) == c; ++i) {
-                                               if (cur.pit() == pit)
+                                               if (cur.pit() == pit && 
cur.pos() > 0)
                                                        cur.posBackward();
-                                               if (cur.realAnchor().pit() == 
pit
-                                                         && 
cur.realAnchor().pos() > 0 )
+                                               if (cur.realAnchor().pit() == 
pit && cur.realAnchor().pos() > 0)
                                                        
cur.realAnchor().backwardPos();
                                                par.eraseChar(0, tc);
                                        }
diff --git a/status.24x b/status.24x
index 77034ea06f..4ad8487467 100644
--- a/status.24x
+++ b/status.24x
@@ -121,7 +121,10 @@ What's new
   and xltable), as this is not supported by the packages. Also fix the
   disabling mechanism in the table dialog.
 
-- Fix display of integral limits on Windows (bug 13087)
+- Fix display of integral limits on Windows (bug 13087).
+
+- Fix crash when deleting tabs in a selection (with S-BackTab) in a
+  text-only inset (ERT, Listings...).
 
 
 * INTERNALS
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to