Do not set layout for no-op paragraph break

When breaking paragraph in an empty top-level paragraph, nothing
happens on screen but yet there is an undo step because the layout is
reset to what it already was.

Avoid this case.

Fixes bug #10089.
(cherry picked from commit 2ad52918da)
This commit is contained in:
Jean-Marc Lasgouttes 2016-08-24 15:29:17 +02:00
parent 1dc8278fef
commit bbeb3773a1
2 changed files with 4 additions and 1 deletions

View File

@ -769,7 +769,8 @@ void Text::breakParagraph(Cursor & cur, bool inverse_logic)
else {
docstring const & lay = cur.paragraph().usePlainLayout()
? tclass.plainLayoutName() : tclass.defaultLayoutName();
setLayout(cur, lay);
if (lay != layout.name())
setLayout(cur, lay);
}
return;
}

View File

@ -106,6 +106,8 @@ What's new
- Fix the minimum size of the citation dialog on first time (bug 10019).
- When Enter does nothing (empty paragraph), do not record undo (bug 10089).
* INTERNALS