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 16be88ca18)
This commit is contained in:
Jean-Marc Lasgouttes 2024-08-30 16:56:16 +02:00
parent d7e2ca377f
commit 5ca48a7a39
2 changed files with 6 additions and 4 deletions

View File

@ -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);
}

View File

@ -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