mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 11:16:55 +00:00
Do not try to put cursor after space if no space was kept
The logic was wrong and could cause crashes Fixes bug #11777.
This commit is contained in:
parent
f293de29d9
commit
cc5d3bd9f4
@ -797,8 +797,9 @@ void fixCursorAfterDelete(CursorSlice & cur, CursorSlice const & where,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// If cursor position is after the deletion place update it
|
// 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)
|
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
|
// Check also if we don't want to set the cursor on a spot behind the
|
||||||
// pagragraph because we erased the last character.
|
// pagragraph because we erased the last character.
|
||||||
|
@ -105,6 +105,8 @@ What's new
|
|||||||
- Avoid crash in some cases where a dialog is shown during operation
|
- Avoid crash in some cases where a dialog is shown during operation
|
||||||
(bug 11763).
|
(bug 11763).
|
||||||
|
|
||||||
|
- Fix crash with nested insets when spaces are removed automatically (bug 11777).
|
||||||
|
|
||||||
* INTERNALS
|
* INTERNALS
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user