From 9791f192f8bff3a30bad6b4fae531a439d24c6e8 Mon Sep 17 00:00:00 2001 From: Camille Scholtz Date: Fri, 20 May 2016 19:46:18 +0200 Subject: [PATCH] Move scrollmargin declaration --- cmd/micro/view.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 22a304c3..cc39d6d7 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -260,7 +260,6 @@ func (v *View) HandleEvent(event tcell.Event) { // This bool determines whether the view is relocated at the end of the function // By default it's true because most events should cause a relocate relocate := true - scrollmargin := int(settings["scrollmargin"].(float64)) switch e := event.(type) { case *tcell.EventResize: @@ -382,6 +381,7 @@ func (v *View) HandleEvent(event tcell.Event) { } if relocate { + scrollmargin := int(settings["scrollmargin"].(float64)) v.Relocate(scrollmargin) } if settings["syntax"].(bool) {