mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Don't show append function where it does not make sense.
This commit is contained in:
parent
5c704b5dd1
commit
612536305b
@ -1856,6 +1856,7 @@ 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;
|
||||
@ -1885,10 +1886,12 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv)
|
||||
add(MenuItem(MenuItem::Command, toqstr(label),
|
||||
FuncRequest(LFUN_ENVIRONMENT_SPLIT,
|
||||
from_ascii("before"))));
|
||||
label = bformat(_("Append New Environment (%1$s)"),
|
||||
translateIfPossible(curlayout));
|
||||
add(MenuItem(MenuItem::Command, toqstr(label),
|
||||
FuncRequest(LFUN_ENVIRONMENT_SPLIT)));
|
||||
if (!par.layout().keepempty || pos > 0 || !text->isFirstInSequence(pit)) {
|
||||
label = bformat(_("Append New Environment (%1$s)"),
|
||||
translateIfPossible(curlayout));
|
||||
add(MenuItem(MenuItem::Command, toqstr(label),
|
||||
FuncRequest(LFUN_ENVIRONMENT_SPLIT)));
|
||||
}
|
||||
}
|
||||
else if (!prevlayout.empty()) {
|
||||
docstring const label =
|
||||
|
Loading…
Reference in New Issue
Block a user