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;