commit 63be48aca2ee9a6dc39a9a19f10c43fb936d9bcf
Author: Koji Yokota <[email protected]>
Date:   Wed Aug 27 00:12:48 2025 +0900

    Disable input method in InsetMathMacro
---
 src/frontends/qt/GuiInputMethod.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/frontends/qt/GuiInputMethod.cpp 
b/src/frontends/qt/GuiInputMethod.cpp
index 42ef033298..fad4538444 100644
--- a/src/frontends/qt/GuiInputMethod.cpp
+++ b/src/frontends/qt/GuiInputMethod.cpp
@@ -23,6 +23,7 @@
 #include "GuiFontLoader.h"
 #include "GuiWorkArea.h"
 #include "InsetList.h"
+#include "mathed/InsetMathMacro.h"
 #include "KeyMap.h"
 #include "Language.h"
 #include "LyX.h"
@@ -131,10 +132,12 @@ void GuiInputMethod::toggleInputMethodAcceptance(){
                        d->cur_->getFont().language()->inputMethodOffInMath();
 
        // note that d->cur_->inset() is a cache so it lags from actual key 
moves
+       bool inMathMode = d->cur_->inset().currentMode() == Inset::MATH_MODE;
+       bool inMathMacro = d->cur_->inset().asInsetMath() != nullptr &&
+                          d->cur_->inset().asInsetMath()->asMacroInset() != 
nullptr;
        bool enabled =
-               !((d->im_off_in_math_
-                  && d->cur_->inset().currentMode() == Inset::MATH_MODE)
-                 || guiApp->isInCommandMode());
+               !((d->im_off_in_math_ && (inMathMode || inMathMacro)) ||
+                 guiApp->isInCommandMode());
        if (enabled != d->im_state_.enabled_) {
                d->im_state_.enabled_= enabled;
                Q_EMIT inputMethodStateChanged(Qt::ImEnabled);
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to