From d3c5e3ab4714dff19c437abbeb163e4a7420f8be Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Thu, 13 Oct 2016 17:09:15 -0400 Subject: [PATCH] Improvements for softwrap mouse support --- cmd/micro/view.go | 4 ++++ 1 file changed, 4 insertions(+) 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++ }