]> git.lyx.org Git - features.git/commitdiff
Add a "nogui" option to the inset-edit lfun (bug 11956).
authorPavel Sanda <sanda@lyx.org>
Sun, 23 Jul 2023 23:21:52 +0000 (01:21 +0200)
committerPavel Sanda <sanda@lyx.org>
Sun, 23 Jul 2023 23:21:52 +0000 (01:21 +0200)
src/LyXAction.cpp
src/insets/InsetCollapsible.cpp

index 9ebf307d6e25051ea6b2b4c121856de2ee52d6a4..3391e228d2f949e9b7b538b0c091b697bd3c1081 100644 (file)
@@ -2134,9 +2134,11 @@ void LyXAction::init()
                the inset is locked, and the temporary file is edited.
                In this case, #LFUN_INSET_END_EDIT must be called to overtake
                the changes and unlock the inset after editing is finished.
- * \li Syntax: inset-edit [<INSET_PARAMS>]
+ * \li Syntax: inset-edit [nogui] [<INSET_PARAMS>]
  * \li Params: <INSET_PARAMS>: Parameters for the inset. \n
-                               Currently only the filename will be considered.
+                               Currently only the filename will be considered.\n
+               nogui: does not launch external editor, only returns filename
+                      to be processed.
  * \li Origin: spitz, 27 Apr 2006
  * \endvar
  */
index 56d8ce80875d1d4ca94adf626f5001ac5f6daf3d..eb04ca85277b6560348860e56844d995315b3964 100644 (file)
@@ -626,7 +626,12 @@ void InsetCollapsible::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.clearSelection();
                cur.pop();
                cur.leaveInset(*this);
-               theFormats().edit(buffer(), tempfilename, format);
+
+               if (cmd.argument() == "nogui")
+                       cur.message(from_utf8(name));
+               else
+                       theFormats().edit(buffer(), tempfilename, format);
+
                break;
        }
        case LFUN_INSET_END_EDIT: {