X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView.cpp;h=831fa8565ce8dce57159696894309784f94d0971;hb=e64ea3576c4534fc647a74d1c9f5e67db39ef783;hp=7828be1d3dce8326562dfcb779740901ee07cce3;hpb=4f10c0a14b8ac455be4bc430dec07f033b7282ac;p=features.git diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 7828be1d3d..831fa8565c 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -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(); }