commit d9018f14a61502636aaf84480113deca69def5db
Author: Guillaume Munch <g...@lyx.org>
Date:   Thu Jan 5 12:03:53 2017 +0100

    Fine tune the math class of InsetMathScript after a4676712
---
 src/mathed/InsetMathScript.cpp |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp
index 22a226d..a4ffd57 100644
--- a/src/mathed/InsetMathScript.cpp
+++ b/src/mathed/InsetMathScript.cpp
@@ -276,13 +276,16 @@ int InsetMathScript::nker(BufferView const * bv) const
 MathClass InsetMathScript::mathClass() const
 {
        // FIXME: this is a hack, since the class will not be correct if
-       // the nucleus has several elements.
+       // the nucleus has several elements or if the last element is a math 
macro
+       // or a macro argument proxy.
        // The correct implementation would require to linearize the nucleus.
        if (nuc().empty())
                return MC_ORD;
-       else
+       else {
                // return the class of last element since this is the one that 
counts.
-               return nuc().back()->mathClass();
+               MathClass mc = nuc().back()->mathClass();
+               return (mc == MC_UNKNOWN) ? MC_ORD : mc;
+       }
 }
 
 

Reply via email to