mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Fix DEPM at end of paragraph
Remove special handling of spaces at end of paragraph. Now they are
handled like interword spaces by both DEPM methods.
Fix off-by-one error in loop when testing for end of paragraph.
Part of bug #11412.
(adapted from commit c00234503f
)
This commit is contained in:
parent
130a555796
commit
c44dc071a5
@ -860,13 +860,13 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
|
||||
&& !oldpar.isDeleted(from - 1))
|
||||
--from;
|
||||
int to = old.pos();
|
||||
while (to < oldpar.size() - 1
|
||||
while (to < oldpar.size()
|
||||
&& oldpar.isLineSeparator(to)
|
||||
&& !oldpar.isDeleted(to))
|
||||
++to;
|
||||
|
||||
// If we are not at the extremity of the paragraph, keep one space
|
||||
if (from != to && from > 0 && to < oldpar.size())
|
||||
// If we are not at the start of the paragraph, keep one space
|
||||
if (from != to && from > 0)
|
||||
++from;
|
||||
|
||||
if (same_par && cur.pos() >= from && cur.pos() < to)
|
||||
|
Loading…
Reference in New Issue
Block a user