From 2ad52918da1d0f375bf2831df4c51f6afa7ea448 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 24 Aug 2016 15:29:17 +0200 Subject: [PATCH] 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. --- src/Text.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Text.cpp b/src/Text.cpp index 00b575b07a..007271d639 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -743,7 +743,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; }