mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 05:55:34 +00:00
Allow arguments in PassThru environments (bug #7646)
(cherry picked from commit 34ef91bb70
)
This commit is contained in:
parent
0493893fdd
commit
a834d161d2
@ -2257,6 +2257,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
|
|
||||||
FontInfo const & fontinfo = cur.real_current_font.fontInfo();
|
FontInfo const & fontinfo = cur.real_current_font.fontInfo();
|
||||||
bool enable = true;
|
bool enable = true;
|
||||||
|
bool allow_in_passthru = false;
|
||||||
InsetCode code = NO_CODE;
|
InsetCode code = NO_CODE;
|
||||||
|
|
||||||
switch (cmd.action()) {
|
switch (cmd.action()) {
|
||||||
@ -2447,6 +2448,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
break;
|
break;
|
||||||
case LFUN_ARGUMENT_INSERT: {
|
case LFUN_ARGUMENT_INSERT: {
|
||||||
code = ARG_CODE;
|
code = ARG_CODE;
|
||||||
|
allow_in_passthru = true;
|
||||||
Layout const & lay = cur.paragraph().layout();
|
Layout const & lay = cur.paragraph().layout();
|
||||||
int const numargs = lay.reqargs + lay.optargs;
|
int const numargs = lay.reqargs + lay.optargs;
|
||||||
enable = cur.paragraph().insetList().count(ARG_CODE) < numargs;
|
enable = cur.paragraph().insetList().count(ARG_CODE) < numargs;
|
||||||
@ -2811,7 +2813,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
if (code != NO_CODE
|
if (code != NO_CODE
|
||||||
&& (cur.empty()
|
&& (cur.empty()
|
||||||
|| !cur.inset().insetAllowed(code)
|
|| !cur.inset().insetAllowed(code)
|
||||||
|| cur.paragraph().layout().pass_thru))
|
|| (cur.paragraph().layout().pass_thru && !allow_in_passthru)))
|
||||||
enable = false;
|
enable = false;
|
||||||
|
|
||||||
flag.setEnabled(enable);
|
flag.setEnabled(enable);
|
||||||
|
@ -67,6 +67,8 @@ What's new
|
|||||||
|
|
||||||
- When selecting text and Insert > Preview, immediately display the
|
- When selecting text and Insert > Preview, immediately display the
|
||||||
preview (bug 8075).
|
preview (bug 8075).
|
||||||
|
|
||||||
|
- Allow arguments in PassThru environments (bug 7646).
|
||||||
|
|
||||||
|
|
||||||
* DOCUMENTATION AND LOCALIZATION
|
* DOCUMENTATION AND LOCALIZATION
|
||||||
|
Loading…
Reference in New Issue
Block a user