h--
v.width = int(float32(w) * float32(v.widthPercent) / 100)
// We subtract 1 for the statusline
- v.height = int(float32(h)*float32(v.heightPercent)/100) - 1
+ v.height = int(float32(h) * float32(v.heightPercent) / 100)
+ if settings["statusline"].(bool) {
+ // Make room for the status line if it is enabled
+ v.height--
+ }
}
// ScrollUp scrolls the view up n lines (if possible)
// 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
}
func (v *View) Display() {
v.DisplayView()
v.Cursor.Display()
- v.sline.Display()
+ if settings["statusline"].(bool) {
+ v.sline.Display()
+ }
}