Move scrollmargin declaration

This commit is contained in:
Camille Scholtz
2016-05-20 19:46:18 +02:00
parent 116b247439
commit 9791f192f8

View File

@@ -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) {