]> git.lyx.org Git - features.git/commitdiff
Do not set layout for no-op paragraph break
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 24 Aug 2016 13:29:17 +0000 (15:29 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 29 Aug 2016 10:09:53 +0000 (12:09 +0200)
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 2ad52918da1d0f375bf2831df4c51f6afa7ea448)

src/Text.cpp
status.22x

index a47d4b1c52ec148f16f012f8b78380f7b92dca00..a6176bc08ac09e0648c55016239d1eab569bf2c7 100644 (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;
        }
index f4bc1bc68d319d9313f87f232005f1c38cbefdda..1ad21c346a4ca9733305db92eb92b532ed69e740 100644 (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