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.
This commit is contained in:
Jean-Marc Lasgouttes 2016-08-24 15:29:17 +02:00
parent 07c7dae367
commit 2ad52918da

View File

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