]> git.lyx.org Git - features.git/commitdiff
Always place the cursor before a separator inset when clicking
authorEnrico Forestieri <forenr@lyx.org>
Sat, 16 Jan 2016 15:41:04 +0000 (16:41 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Sat, 16 Jan 2016 15:41:04 +0000 (16:41 +0100)
src/BufferView.cpp

index 7332ec592115ccfb38046a05cdda82dbc36dd205..6de832dae58715af6b55b0286c882e39595b596d 100644 (file)
@@ -2512,8 +2512,11 @@ bool BufferView::mouseSetCursor(Cursor & cur, bool select)
        // FIXME: (2) if we had a working InsetText::notifyCursorLeaves,
        // the leftinset bool would not be necessary (badcursor instead).
        bool update = leftinset;
-       if (!do_selection && d->cursor_.inTexted())
+       if (!do_selection && d->cursor_.inTexted()) {
                update |= checkDepm(cur, d->cursor_);
+               if (cur.pos() && cur.paragraph().isEnvSeparator(cur.pos() - 1))
+                   cur.posBackward();
+       }
 
        if (!do_selection)
                d->cursor_.resetAnchor();