mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
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.
This commit is contained in:
parent
2eb4e3d3ca
commit
16be88ca18
@ -4629,10 +4629,9 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
int const n = (c == ' ' ? 4 : 1);
|
int const n = (c == ' ' ? 4 : 1);
|
||||||
for (int i = 0; i < n
|
for (int i = 0; i < n
|
||||||
&& !par.empty() && par.getChar(0) == c; ++i) {
|
&& !par.empty() && par.getChar(0) == c; ++i) {
|
||||||
if (cur.pit() == pit)
|
if (cur.pit() == pit && cur.pos() > 0)
|
||||||
cur.posBackward();
|
cur.posBackward();
|
||||||
if (cur.realAnchor().pit() == pit
|
if (cur.realAnchor().pit() == pit && cur.realAnchor().pos() > 0)
|
||||||
&& cur.realAnchor().pos() > 0 )
|
|
||||||
cur.realAnchor().backwardPos();
|
cur.realAnchor().backwardPos();
|
||||||
par.eraseChar(0, tc);
|
par.eraseChar(0, tc);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user