]> git.lyx.org Git - features.git/blobdiff - src/BufferView.cpp
Avoid some caret ghosts
[features.git] / src / BufferView.cpp
index 7828be1d3dce8326562dfcb779740901ee07cce3..831fa8565ce8dce57159696894309784f94d0971 100644 (file)
@@ -2975,7 +2975,7 @@ namespace {
 bool sliceInRow(CursorSlice const & cs, Text const * text, Row const & row)
 {
        return !cs.empty() && cs.text() == text && cs.pit() == row.pit()
-               && row.pos() <= cs.pos() && cs.pos() <= row.endpos();
+               && row.pos() <= cs.pos() && cs.pos() < row.endpos();
 }
 
 }
@@ -3158,9 +3158,11 @@ void BufferView::draw(frontend::Painter & pain, bool paint_caret)
        }
 
        // Remember what has just been done for the next draw() step
-       if (paint_caret)
+       if (paint_caret) {
                d->caret_slice_ = d->cursor_.top();
-       else
+               if (d->cursor_.boundary())
+                       --d->caret_slice_.pos();
+       } else
                d->caret_slice_ = CursorSlice();
 }