commit cc5d3bd9f445e99018dc94e6dceb9c1140c09d09
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Mon Apr 13 12:58:43 2020 +0200

    Do not try to put cursor after space if no space was kept
    
    The logic was wrong and could cause crashes
    
    Fixes bug #11777.
---
 src/Text2.cpp |    3 ++-
 status.23x    |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/Text2.cpp b/src/Text2.cpp
index ce52598..71569db 100644
--- a/src/Text2.cpp
+++ b/src/Text2.cpp
@@ -797,8 +797,9 @@ void fixCursorAfterDelete(CursorSlice & cur, CursorSlice 
const & where,
                return;
 
        // If cursor position is after the deletion place update it
+       // but if we are not at start of line keep it after the space that was 
kept.
        if (cur.pos() > from)
-               cur.pos() = max(from + 1, cur.pos() - num_chars);
+               cur.pos() = max(from + (from > 0), cur.pos() - num_chars);
 
        // Check also if we don't want to set the cursor on a spot behind the
        // pagragraph because we erased the last character.
diff --git a/status.23x b/status.23x
index acd7e12..d184ac5 100644
--- a/status.23x
+++ b/status.23x
@@ -105,6 +105,8 @@ What's new
 - Avoid crash in some cases where a dialog is shown during operation
   (bug 11763).
 
+- Fix crash with nested insets when spaces are removed automatically (bug 
11777).
+
 * INTERNALS
 
 
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to