commit a8ab3379d97614f3d290cb9d7cdd9ec524047bbe
Author: Enrico Forestieri <[email protected]>
Date:   Wed Jan 13 22:49:33 2016 +0100

    Insert a separator only when the paragraph is empty.

diff --git a/src/Text3.cpp b/src/Text3.cpp
index ee0902a..0933000 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();

Reply via email to