]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
Russian layouttranslations reviewed by Yuriy, Dec 13 2017.
[lyx.git] / src / BufferView.cpp
index 7828be1d3dce8326562dfcb779740901ee07cce3..29bb53b8f7e71708a8c54211fda8b4f665256b77 100644 (file)
@@ -2611,12 +2611,6 @@ Cursor const & BufferView::cursor() const
 }
 
 
-pit_type BufferView::anchor_ref() const
-{
-       return d->anchor_pit_;
-}
-
-
 bool BufferView::singleParUpdate()
 {
        Text & buftext = buffer_.text();
@@ -2975,7 +2969,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 +3152,12 @@ 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->cursor_.top().pos() == d->cursor_.top().lastpos())
+                       --d->caret_slice_.pos();
+       } else
                d->caret_slice_ = CursorSlice();
 }