]> git.lizzy.rs Git - micro.git/commitdiff
Fix: mouse clicking with softwrap
authorNicolai Søborg <NicolaiSoeborg@users.noreply.github.com>
Sat, 17 Dec 2016 23:27:06 +0000 (00:27 +0100)
committerGitHub <noreply@github.com>
Sat, 17 Dec 2016 23:27:06 +0000 (00:27 +0100)
When clicking on a long line with softwrap turned on, the cursor will show up in the wrong location (`screenY` will be wrong in `GetSoftWrapLocation`). This seems to fix it.

cmd/micro/view.go

index 80ca49424f7da16bbce757f8b3a617450f4e0836..269acd43c0862991c1abe3438267e942c1e169bf 100644 (file)
@@ -418,9 +418,6 @@ func (v *View) MoveToMouseClick(x, y int) {
                v.ScrollDown(1)
                y = v.Height + v.Topline - 1
        }
-       if y >= v.Buf.NumLines {
-               y = v.Buf.NumLines - 1
-       }
        if y < 0 {
                y = 0
        }