]> git.lyx.org Git - features.git/blobdiff - src/BufferView.cpp
Avoid some caret ghosts
[features.git] / src / BufferView.cpp
index 4e2428d7d7afe675ab24f71b576fc5719c584dac..831fa8565ce8dce57159696894309784f94d0971 100644 (file)
@@ -1633,10 +1633,8 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                InsetBibtex * inset = getInsetByCode<InsetBibtex>(tmpcur,
                                                BIBTEX_CODE);
                if (inset) {
-                       if (inset->addDatabase(cmd.argument())) {
-                               buffer_.invalidateBibfileCache();
+                       if (inset->addDatabase(cmd.argument()))
                                dr.forceBufferUpdate();
-                       }
                }
                break;
        }
@@ -1647,10 +1645,8 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                InsetBibtex * inset = getInsetByCode<InsetBibtex>(tmpcur,
                                                BIBTEX_CODE);
                if (inset) {
-                       if (inset->delDatabase(cmd.argument())) {
-                               buffer_.invalidateBibfileCache();
+                       if (inset->delDatabase(cmd.argument()))
                                dr.forceBufferUpdate();
-                       }
                }
                break;
        }
@@ -2979,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();
 }
 
 }
@@ -3162,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();
 }