mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-09 22:30:24 +09:00
Merge pull request #112 from onodera-punpun/customizable_scrolling
Add scrollspeed option
This commit is contained in:
@@ -79,6 +79,7 @@ func DefaultSettings() map[string]interface{} {
|
||||
"tabsToSpaces": false,
|
||||
"ruler": true,
|
||||
"statusline": true,
|
||||
"scrollSpeed": float64(2),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -199,6 +199,10 @@ Here are the options that you can set:
|
||||
|
||||
default value: `on`
|
||||
|
||||
* `scrollspeed`: amount of lines to scroll
|
||||
|
||||
default value: `2`
|
||||
|
||||
---
|
||||
|
||||
Default plugin options:
|
||||
|
||||
Reference in New Issue
Block a user