From ae14d8fe343ea3df5e56f9b5f1065aa94a9ee3da Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Tue, 21 Apr 2015 21:11:17 -0400 Subject: [PATCH] Update previews when going to a bookmark (#6173) Note that I move the definition of cur up because we need to check if it changed before the return. I also removed the const because notifyCursorLeavesOrEnters() requires that. This commit probably fixes other issues for any inset that defines notifyCursorLeaves(). This fixes only part of #6173. --- src/frontends/qt4/GuiApplication.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 94c63461c1..4822e59967 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -1438,6 +1438,7 @@ void GuiApplication::gotoBookmark(unsigned int idx, bool openFile, // if the current buffer is not that one, switch to it. BufferView * doc_bv = current_view_ ? current_view_->documentBufferView() : 0; + Cursor const old = doc_bv->cursor(); if (!doc_bv || doc_bv->buffer().fileName() != tmp.filename) { if (switchToBuffer) { dispatch(FuncRequest(LFUN_BUFFER_SWITCH, file)); @@ -1453,12 +1454,15 @@ void GuiApplication::gotoBookmark(unsigned int idx, bool openFile, tmp.bottom_pit, tmp.bottom_pos, tmp.top_id, tmp.top_pos)) return; + Cursor & cur = doc_bv->cursor(); + if (cur != old) + notifyCursorLeavesOrEnters(old, cur); + // bm changed if (idx == 0) return; // Cursor jump succeeded! - Cursor const & cur = doc_bv->cursor(); pit_type new_pit = cur.pit(); pos_type new_pos = cur.pos(); int new_id = cur.paragraph().id(); -- 2.39.5