diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 33b27521..e22e0e69 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -283,6 +283,7 @@ func (v *View) VSplit(buf *Buffer) bool { func (v *View) GetSoftWrapLocation(vx, vy int) (int, int) { if !v.Buf.Settings["softwrap"].(bool) { + vx = v.Cursor.GetCharPosInLine(vy, vx) return vx, vy } @@ -308,6 +309,9 @@ func (v *View) GetSoftWrapLocation(vx, vy int) (int, int) { screenX++ colN++ } + if screenY == vy { + return colN, lineN + } screenX = 0 screenY++ }