]> git.lizzy.rs Git - micro.git/blobdiff - cmd/micro/view.go
Merge pull request #112 from onodera-punpun/customizable_scrolling
[micro.git] / cmd / micro / view.go
index f44ee174f51c4336b9a02a289a5c18120c346ee4..cd6353d109ac85168cf0d5fdb3afe313b5a31ffa 100644 (file)
@@ -366,13 +366,15 @@ func (v *View) HandleEvent(event tcell.Event) {
                        // every time the user moves the cursor
                        relocate = false
                case tcell.WheelUp:
-                       // Scroll up two lines
-                       v.ScrollUp(2)
+                       // 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 two lines
-                       v.ScrollDown(2)
+                       // Scroll down
+                       scrollSpeed := int(settings["scrollspeed"].(float64))
+                       v.ScrollDown(scrollSpeed)
                        // We don't want to relocate if the user is scrolling
                        relocate = false
                }