From: Abdelrazak Younes Date: Fri, 22 Feb 2008 12:27:56 +0000 (+0000) Subject: Text::setCursor(): make sure an update is asked if the current cursor is not visible. X-Git-Tag: 1.6.10~6166 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a19557baf76c7e2fd1c75f1d415b9719ab68cb4e;p=features.git Text::setCursor(): make sure an update is asked if the current cursor is not visible. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23128 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Text2.cpp b/src/Text2.cpp index a4f78271a4..fff739ed47 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -525,9 +525,11 @@ void Text::insertStringAsParagraphs(Cursor & cur, docstring const & str) bool Text::setCursor(Cursor & cur, pit_type par, pos_type pos, bool setfont, bool boundary) { + TextMetrics const & tm = cur.bv().textMetrics(this); + bool const update_needed = !tm.has(par); Cursor old = cur; setCursorIntern(cur, par, pos, setfont, boundary); - return cur.bv().checkDepm(cur, old); + return cur.bv().checkDepm(cur, old) || update_needed; }