]> git.lyx.org Git - lyx.git/commitdiff
Account for shadowed system macros
authorEnrico Forestieri <forenr@lyx.org>
Sun, 22 Oct 2017 21:09:37 +0000 (23:09 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 22 Oct 2017 21:15:56 +0000 (23:15 +0200)
Part of #10694.

(cherry picked from commit d58d3f677442fc8b2ee2454a1da8f5eedd8b95ac)

src/Cursor.cpp

index b82da98ad85e303caf5e53d9c35057f4cd369ce9..997f5d5535217dba5dc9a03e273e5ed6e1b8dfe1 100644 (file)
@@ -1464,9 +1464,10 @@ bool Cursor::macroModeClose()
 
        MathWordList const & words = mathedWordList();
        MathWordList::const_iterator it = words.find(name);
-       bool keep_mathmode = it != words.end() && (it->second.inset == "font"
-                                               || it->second.inset == "oldfont"
-                                               || it->second.inset == "mbox");
+       bool keep_mathmode = user_macro
+               || (it != words.end() && (it->second.inset == "font"
+                                         || it->second.inset == "oldfont"
+                                         || it->second.inset == "mbox"));
        bool ert_macro = !user_macro && it == words.end() && atomAsMacro;
 
        if (in && in->currentMode() == Inset::TEXT_MODE