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
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();
// 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;