From ad8f57427750063618ffb18a41a15874c4761ec1 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Tue, 25 Jun 2019 21:27:33 +0200 Subject: [PATCH] Fix bug #10498 Use the selection as the argument of a macro also when the macro has only optional arguments. --- src/Cursor.cpp | 2 +- status.23x | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Cursor.cpp b/src/Cursor.cpp index e277c880fa..dc381479e6 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -1487,7 +1487,7 @@ 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()) { macroArg = true; atomAsMacro->setDisplayMode(InsetMathMacro::DISPLAY_INTERACTIVE_INIT, 1); } else diff --git a/status.23x b/status.23x index 349dd036c4..8067c74849 100644 --- a/status.23x +++ b/status.23x @@ -57,6 +57,9 @@ The "Rows & Columns" optional submenu has been added to the math context menu. - Fix endless loop when a macro definition references itself (bug 11595). +- Use the selection as the argument of a macro also when the macro has only + optional arguments (bug 10498). + * INTERNALS -- 2.39.5