mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
widget: reset Editor x offset on mouse initiated caret movement
The caret x-offset tracks residual horizontal offset for arrow key movements. Caret movement by the mouse should reset the residual. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -441,6 +441,7 @@ func (e *Editor) moveCoord(pos image.Point) {
|
|||||||
carLine++
|
carLine++
|
||||||
}
|
}
|
||||||
x := fixed.I(pos.X + e.scrollOff.X)
|
x := fixed.I(pos.X + e.scrollOff.X)
|
||||||
|
e.carXOff = 0
|
||||||
e.moveToLine(x, carLine)
|
e.moveToLine(x, carLine)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user