]> git.lyx.org Git - features.git/blobdiff - src/Text3.cpp
Code cleanup in GuiCompleter
[features.git] / src / Text3.cpp
index a87169b9344a4efefb20eb8950a0876802e425c8..529e756a97742b0035b180af1dc01c8eba84f091 100644 (file)
@@ -299,8 +299,11 @@ static bool doInsertInset(Cursor & cur, Text * text,
                         * paragraph and the inset allows setting layout
                         * FIXME: this does not work as expected when change tracking is on
                         *   However, we do not really know what to do in this case.
+                        * FIXME: figure out a good test in the environment case (see #12251).
                         */
-                       if (cur.paragraph().empty() && !inset->forcePlainLayout()) {
+                       if (cur.paragraph().layout().isCommand()
+                            && cur.paragraph().empty()
+                            && !inset->forcePlainLayout()) {
                                cur.paragraph().setPlainOrDefaultLayout(bparams.documentClass());
                                move_layout = true;
                        }