From a8ab3379d97614f3d290cb9d7cdd9ec524047bbe Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 13 Jan 2016 22:49:33 +0100 Subject: [PATCH] Insert a separator only when the paragraph is empty. --- src/Text3.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index ee0902a87a..0933000838 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1107,13 +1107,11 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) prev = pit - 1; } if (prev < pit && cur.pos() == par.beginOfBody() - && !par.isEnvSeparator(par.size() ? par.size() - 1 : 0) + && !par.size() && !par.isEnvSeparator(cur.pos()) && !par.layout().isCommand() && pars_[prev].layout() != par.layout() && pars_[prev].layout().isEnvironment() - && (!nextpar.isEnvSeparator(nextpar.size() ? nextpar.size() - 1 : 0) - || nextpar.layout().isCommand() - || nextpar.layout().isEnvironment())) { + && !nextpar.isEnvSeparator(nextpar.beginOfBody())) { if (par.layout().isEnvironment() && pars_[prev].getDepth() == par.getDepth()) { docstring const layout = par.layout().name();