mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Disable useless environment-split function at the core.
This commit is contained in:
parent
7d2764fb9e
commit
f965d23633
@ -3244,7 +3244,8 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||
break;
|
||||
}
|
||||
else if (cur.paragraph().layout().isEnvironment()) {
|
||||
enable = true;
|
||||
enable = cmd.argument() == "before"
|
||||
|| cur.pos() > 0 || !isFirstInSequence(cur.pit());
|
||||
break;
|
||||
}
|
||||
enable = false;
|
||||
|
@ -1865,7 +1865,6 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv,
|
||||
return;
|
||||
|
||||
pit_type pit = bv->cursor().selBegin().pit();
|
||||
pos_type pos = bv->cursor().selBegin().pos();
|
||||
Paragraph const & par = text->getPar(pit);
|
||||
docstring const curlayout = par.layout().name();
|
||||
docstring outerlayout;
|
||||
@ -1898,7 +1897,6 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv,
|
||||
add(MenuItem(MenuItem::Command, toqstr(label),
|
||||
FuncRequest(LFUN_ENVIRONMENT_SPLIT,
|
||||
from_ascii("before"))));
|
||||
if (!par.layout().keepempty || pos > 0 || !text->isFirstInSequence(pit)) {
|
||||
label = contextmenu ?
|
||||
bformat(_("Insert Separated %1$s Below"),
|
||||
translateIfPossible(curlayout)):
|
||||
@ -1906,11 +1904,11 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv,
|
||||
translateIfPossible(curlayout));
|
||||
// We use command-alternatives here since this is how the binding is defined
|
||||
// (otherwise, the binding is not displayed in the menu)
|
||||
if (getStatus(FuncRequest(LFUN_ENVIRONMENT_SPLIT)).enabled())
|
||||
add(MenuItem(MenuItem::Command, toqstr(label),
|
||||
FuncRequest(LFUN_COMMAND_ALTERNATIVES,
|
||||
from_ascii("environment-split ; environment-split previous"))));
|
||||
}
|
||||
}
|
||||
else if (!prevlayout.empty()) {
|
||||
docstring const label = contextmenu ?
|
||||
bformat(_("Insert Separated %1$s Below"),
|
||||
|
Loading…
Reference in New Issue
Block a user