mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Handle properly top/bottom of inset with mac-like cursor movement
The correct behavior is to go to position 0 going up from first row, and to end of row when going down on last row. The targetx value of the cursor is not updated, which makes cursor movement more natural. Fixes bug #10701.
This commit is contained in:
parent
e64ea3576c
commit
34285cc683
@ -770,6 +770,18 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
cur.upDownInText(up, needsUpdate);
|
||||
needsUpdate |= cur.beforeDispatchCursor().inMathed();
|
||||
} else {
|
||||
pos_type newpos = up ? 0 : cur.lastpos();
|
||||
if (lyxrc.mac_like_cursor_movement && cur.pos() != newpos) {
|
||||
needsUpdate |= cur.selHandle(select);
|
||||
// we do not reset the targetx of the cursor
|
||||
cur.pos() = newpos;
|
||||
needsUpdate |= bv->checkDepm(cur, bv->cursor());
|
||||
cur.updateTextTargetOffset();
|
||||
if (needsUpdate)
|
||||
cur.forceBufferUpdate();
|
||||
break;
|
||||
}
|
||||
|
||||
// if the cursor cannot be moved up or down do not remove
|
||||
// the selection right now, but wait for the next dispatch.
|
||||
if (select)
|
||||
|
Loading…
Reference in New Issue
Block a user