commit 8f7b40955cc34e31a2932906d334499ef1af3665
Author: Enrico Forestieri <for...@lyx.org>
Date:   Sun Oct 22 23:09:37 2017 +0200

    Account for shadowed system macros
    
    Part of #10694.
    
    (cherry picked from commit d58d3f677442fc8b2ee2454a1da8f5eedd8b95ac)
---
 src/Cursor.cpp |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index b82da98..997f5d5 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -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

Reply via email to