From aef75f9b831226bf0c7ee654e6e0142d560591aa Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Sat, 24 Dec 2016 15:34:01 -0500 Subject: [PATCH] Fix bug with mouse clicks Fixes #504 --- cmd/micro/view.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 1a2fad54..6fa0d07c 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -427,6 +427,9 @@ func (v *View) MoveToMouseClick(x, y int) { x, y = v.GetSoftWrapLocation(x, y) // x = v.Cursor.GetCharPosInLine(y, x) + if y > v.Buf.NumLines { + y = v.Buf.NumLines - 1 + } if x > Count(v.Buf.Line(y)) { x = Count(v.Buf.Line(y)) }