]> git.lyx.org Git - lyx.git/blobdiff - src/Text2.cpp
Beamer: autonest column in columns
[lyx.git] / src / Text2.cpp
index d8a9114576d7b6bca6ce69fa8c81aec9beec01dc..cb394c2f0fc9f6e7a66268f247dc5d50fc9519fb 100644 (file)
@@ -845,7 +845,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
                && old.pos() == cur[depth].pos();
 
        // If the chars around the old cursor were spaces, delete some of
-       // them , but only if the cursor has really moved.
+       // them, but only if the cursor has really moved.
        if (!same_par_pos) {
                // find range of spaces around cursors
                int from = old.pos();
@@ -863,6 +863,9 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
                if (from != to && from > 0 && to < oldpar.size())
                        ++from;
 
+               if (same_par && cur.pos() > from && cur.pos() < to)
+                       ++from;
+
                // Remove spaces and adapt cursor.
                if (from < to) {
                        oldpar.eraseChars(from, to, cur.buffer()->params().track_changes);
@@ -879,7 +882,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
                }
        }
 
-       // only do our magic if we changed paragraph
+       // only do our other magic if we changed paragraph
        if (same_par)
                return false;
 
@@ -947,13 +950,11 @@ void Text::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool tra
                        while (from < par.size()
                               && (!par.isLineSeparator(from) || par.isDeleted(from)))
                                ++from;
-                       LYXERR0("from=" << from);
                        // find string of spaces
                        pos_type to = from;
                        while (to < par.size()
                               && par.isLineSeparator(to) && !par.isDeleted(to))
                                ++to;
-                       LYXERR0("to=" << to);
                        // empty? We are done
                        if (from == to)
                                break;