X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView.cpp;h=8a947c169fb12e30e80f6aff2bd8065a0406cd69;hb=51cc8aa9f6b784f806b1d9cc97fe0749ffac29af;hp=c8b376385d2689c318bb018d8be97a3af5890ef0;hpb=fbe333245ed099e68c58d36c18e4355738411ac1;p=lyx.git diff --git a/src/BufferView.cpp b/src/BufferView.cpp index c8b376385d..8a947c169f 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -1415,20 +1415,21 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr) for (Buffer * b = &buffer_; i == 0 || b != &buffer_; b = theBufferList().next(b)) { - DocIterator dit = b->getParFromID(id); - if (dit.atEnd()) { + Cursor cur(*this); + cur.setCursor(b->getParFromID(id)); + if (cur.atEnd()) { LYXERR(Debug::INFO, "No matching paragraph found! [" << id << "]."); ++i; continue; } - LYXERR(Debug::INFO, "Paragraph " << dit.paragraph().id() + LYXERR(Debug::INFO, "Paragraph " << cur.paragraph().id() << " found in buffer `" << b->absFileName() << "'."); if (b == &buffer_) { // Set the cursor - dit.pos() = pos; - setCursor(dit); + cur.pos() = pos; + mouseSetCursor(cur); dr.screenUpdate(Update::Force | Update::FitCursor); } else { // Switch to other buffer view and resend cmd @@ -1747,6 +1748,8 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr) Cursor old = cur; bool const in_texted = cur.inTexted(); cur.setCursor(doc_iterator_begin(cur.buffer())); + if (cur != old) + notifyCursorLeavesOrEnters(old, cur); cur.selHandle(false); buffer_.changed(true); updateHoveredInset(); @@ -2999,7 +3002,7 @@ void BufferView::checkCursorScrollOffset(PainterInfo & pi) // Horizontal scroll offset of the cursor row in pixels int offset = d->horiz_scroll_offset_; - int const MARGIN = Length(2, Length::EM).inPixels(workWidth()); + int const MARGIN = Length(2, Length::EM).inPixels(pi.base); if (cur_x < offset + MARGIN) { // scroll right offset = cur_x - MARGIN;