Improvements for softwrap mouse support

This commit is contained in:
Zachary Yedidia
2016-10-13 17:09:15 -04:00
parent b13c6c4892
commit d3c5e3ab47

View File

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