Fix bug with mouse clicks

Fixes #504
This commit is contained in:
Zachary Yedidia 2016-12-24 15:34:01 -05:00
parent faec861081
commit aef75f9b83

View file

@ -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))
}