From 6d394efcd93f6425fd1bd6838708b400a3ef1551 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Tue, 17 May 2016 13:39:27 -0400 Subject: [PATCH] Remove some unnecessary code Fixes #104 --- cmd/micro/view.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 99bc65e3..209dc406 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -298,6 +298,7 @@ func (v *View) HandleEvent(event tcell.Event) { x, y := e.Position() x -= v.lineNumOffset - v.leftCol y += v.Topline + // Don't relocate for mouse events relocate = false button := e.Buttons() @@ -363,21 +364,14 @@ func (v *View) HandleEvent(event tcell.Event) { } v.mouseReleased = true } - // We don't want to relocate because otherwise the view will be relocated - // every time the user moves the cursor - relocate = false case tcell.WheelUp: // Scroll up scrollSpeed := int(settings["scrollSpeed"].(float64)) v.ScrollUp(scrollSpeed) - // We don't want to relocate if the user is scrolling - relocate = false case tcell.WheelDown: // Scroll down scrollSpeed := int(settings["scrollSpeed"].(float64)) v.ScrollDown(scrollSpeed) - // We don't want to relocate if the user is scrolling - relocate = false } }