mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 02:28:35 +00:00
Fix assertion from setCursor() in outline-down/up
The function outline() itself can change the cursor position in some
cases so we need to store the old position before calling outline().
Spotted by Kornel. For an example file that triggered the assertion,
see:
https://www.mail-archive.com/search?l=mid&q=20200326183314.09ad4c7c%40admin1-desktop
This commit amends adb7283b
.
This commit is contained in:
parent
5db8b65e46
commit
a1169188c7
@ -2759,19 +2759,23 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
}
|
||||
break;
|
||||
|
||||
case LFUN_OUTLINE_UP:
|
||||
case LFUN_OUTLINE_UP: {
|
||||
pos_type const opos = cur.pos();
|
||||
outline(OutlineUp, cur, this);
|
||||
setCursor(cur, cur.pit(), cur.pos());
|
||||
setCursor(cur, cur.pit(), opos);
|
||||
cur.forceBufferUpdate();
|
||||
needsUpdate = true;
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_OUTLINE_DOWN:
|
||||
case LFUN_OUTLINE_DOWN: {
|
||||
pos_type const opos = cur.pos();
|
||||
outline(OutlineDown, cur, this);
|
||||
setCursor(cur, cur.pit(), cur.pos());
|
||||
setCursor(cur, cur.pit(), opos);
|
||||
cur.forceBufferUpdate();
|
||||
needsUpdate = true;
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_OUTLINE_IN:
|
||||
outline(OutlineIn, cur, this);
|
||||
|
Loading…
Reference in New Issue
Block a user