mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Make DEPM respect current cursor position.
Spaces are now conserved when they surround current cursor. Examples:
abc | def
becomes
abc | def
after DEPM and
abc |
is kept as it is.
Fixes ticket #11412.
(cherry picked from commit dff0c5729e
)
This commit is contained in:
parent
324b828717
commit
714b731e39
@ -868,6 +868,9 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
|
|||||||
if (from != to && from > 0 && to < oldpar.size())
|
if (from != to && from > 0 && to < oldpar.size())
|
||||||
++from;
|
++from;
|
||||||
|
|
||||||
|
if (same_par && cur.pos() > from && cur.pos() < to)
|
||||||
|
++from;
|
||||||
|
|
||||||
// Remove spaces and adapt cursor.
|
// Remove spaces and adapt cursor.
|
||||||
if (from < to) {
|
if (from < to) {
|
||||||
oldpar.eraseChars(from, to, cur.buffer()->params().track_changes);
|
oldpar.eraseChars(from, to, cur.buffer()->params().track_changes);
|
||||||
@ -884,7 +887,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// only do our magic if we changed paragraph
|
// only do our other magic if we changed paragraph
|
||||||
if (same_par)
|
if (same_par)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -39,6 +39,8 @@ What's new
|
|||||||
|
|
||||||
- Insert new graphics inset on the correct cursor position.
|
- Insert new graphics inset on the correct cursor position.
|
||||||
|
|
||||||
|
- Fix regression where spaces are disappearing when editing text (bug 11412).
|
||||||
|
|
||||||
|
|
||||||
* DOCUMENTATION AND LOCALIZATION
|
* DOCUMENTATION AND LOCALIZATION
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user