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:
Elias Naur
2020-06-20 12:07:05 +02:00
parent 2f23a326b8
commit e316f42964
+1
View File
@@ -441,6 +441,7 @@ func (e *Editor) moveCoord(pos image.Point) {
carLine++
}
x := fixed.I(pos.X + e.scrollOff.X)
e.carXOff = 0
e.moveToLine(x, carLine)
}