]> git.lyx.org Git - features.git/blobdiff - src/Text3.cpp
Allow arguments in PassThru environments (bug #7646)
[features.git] / src / Text3.cpp
index 5ec76e3c5e3d7bf253f0a186e50cb36e84dae40a..7a7269668fe87cd43c724f909d66b53fdbaf5a53 100644 (file)
@@ -2321,6 +2321,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
 
        FontInfo const & fontinfo = cur.real_current_font.fontInfo();
        bool enable = true;
+       bool allow_in_passthru = false;
        InsetCode code = NO_CODE;
 
        switch (cmd.action()) {
@@ -2517,6 +2518,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
                break;
        case LFUN_ARGUMENT_INSERT: {
                code = ARG_CODE;
+               allow_in_passthru = true;
                string const arg = cmd.getArg(0);
                if (arg.empty()) {
                        enable = false;
@@ -2913,7 +2915,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
        if (code != NO_CODE
            && (cur.empty() 
                || !cur.inset().insetAllowed(code)
-               || cur.paragraph().layout().pass_thru))
+               || (cur.paragraph().layout().pass_thru && !allow_in_passthru)))
                enable = false;
 
        flag.setEnabled(enable);