mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Allow inserting a blank line also after a nested environment.
This commit is contained in:
parent
c7eb04158f
commit
d4c21b42dd
@ -1071,15 +1071,20 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
cap::replaceSelection(cur);
|
cap::replaceSelection(cur);
|
||||||
pit_type pit = cur.pit();
|
pit_type pit = cur.pit();
|
||||||
Paragraph const & par = pars_[pit];
|
Paragraph const & par = pars_[pit];
|
||||||
pit_type prev =
|
pit_type prev = pit;
|
||||||
pit > 0 && pars_[pit - 1].getDepth() >= par.getDepth() ?
|
if (pit > 0) {
|
||||||
depthHook(pit, par.getDepth()) : pit;
|
if (!pars_[pit - 1].layout().isEnvironment())
|
||||||
|
prev = depthHook(pit, par.getDepth());
|
||||||
|
else if (pars_[pit - 1].getDepth() >= par.getDepth())
|
||||||
|
prev = pit - 1;
|
||||||
|
}
|
||||||
if (prev < pit && cur.pos() == par.beginOfBody()
|
if (prev < pit && cur.pos() == par.beginOfBody()
|
||||||
&& !par.isEnvSeparator(cur.pos())
|
&& !par.isEnvSeparator(cur.pos())
|
||||||
&& !par.layout().isCommand()
|
&& !par.layout().isCommand()
|
||||||
&& pars_[prev].layout() != par.layout()
|
&& pars_[prev].layout() != par.layout()
|
||||||
&& pars_[prev].layout().isEnvironment()) {
|
&& pars_[prev].layout().isEnvironment()) {
|
||||||
if (par.layout().isEnvironment()) {
|
if (par.layout().isEnvironment()
|
||||||
|
&& pars_[prev].getDepth() == par.getDepth()) {
|
||||||
docstring const layout = par.layout().name();
|
docstring const layout = par.layout().name();
|
||||||
DocumentClass const & tc = bv->buffer().params().documentClass();
|
DocumentClass const & tc = bv->buffer().params().documentClass();
|
||||||
lyx::dispatch(FuncRequest(LFUN_LAYOUT, tc.plainLayout().name()));
|
lyx::dispatch(FuncRequest(LFUN_LAYOUT, tc.plainLayout().name()));
|
||||||
|
Loading…
Reference in New Issue
Block a user