From 8bdaacaa5ee88a41241a87df632160fd4b3d3675 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Tue, 30 Aug 2016 17:29:49 -0400 Subject: [PATCH] Switch splits on mouse *click* not drag Fixes #240 --- cmd/micro/micro.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/micro/micro.go b/cmd/micro/micro.go index aa301e72..1c46b3a7 100644 --- a/cmd/micro/micro.go +++ b/cmd/micro/micro.go @@ -347,11 +347,13 @@ func main() { continue } - // We loop through each view in the current tab and make sure the current view - // it the one being clicked in - for _, v := range tabs[curTab].views { - if x >= v.x && x < v.x+v.width && y >= v.y && y < v.y+v.height { - tabs[curTab].curView = v.Num + if CurView().mouseReleased { + // We loop through each view in the current tab and make sure the current view + // is the one being clicked in + for _, v := range tabs[curTab].views { + if x >= v.x && x < v.x+v.width && y >= v.y && y < v.y+v.height { + tabs[curTab].curView = v.Num + } } } }