]> git.lyx.org Git - features.git/commitdiff
Fix bug #10498
authorEnrico Forestieri <forenr@lyx.org>
Sat, 18 May 2019 14:06:33 +0000 (16:06 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Sat, 18 May 2019 14:06:33 +0000 (16:06 +0200)
Use the selection as the argument of a macro also when the
macro has only optional arguments.

src/Cursor.cpp

index 56a9dd872245c62f66f345c3679406f52f61f502..39d9654261ba09fc1fef92bdcb36cd6574280868 100644 (file)
@@ -1762,7 +1762,8 @@ bool Cursor::macroModeClose(bool cancel)
                // we have to resolve the macro here manually and check its arity
                // to put the selection behind it if arity > 0.
                MacroData const * data = buffer()->getMacro(atomAsMacro->name());
-               if (!selection.empty() && data && data->numargs() - data->optionals() > 0) {
+               if (!selection.empty() && data && data->numargs()
+                   && data->numargs() - data->optionals() >= 0) {
                        macroArg = true;
                        atomAsMacro->setDisplayMode(InsetMathMacro::DISPLAY_INTERACTIVE_INIT, 1);
                } else