mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-10-09 14:04:45 +03:00
Use a const for the mouse wheel delta in viewport
This commit is contained in:
@@ -7,7 +7,10 @@ import (
|
|||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
)
|
)
|
||||||
|
|
||||||
const spacebar = " "
|
const (
|
||||||
|
spacebar = " "
|
||||||
|
mouseWheelDelta = 3
|
||||||
|
)
|
||||||
|
|
||||||
// MODEL
|
// MODEL
|
||||||
|
|
||||||
@@ -333,13 +336,13 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
|
|||||||
case tea.MouseMsg:
|
case tea.MouseMsg:
|
||||||
switch msg.Type {
|
switch msg.Type {
|
||||||
case tea.MouseWheelUp:
|
case tea.MouseWheelUp:
|
||||||
lines := m.LineUp(3)
|
lines := m.LineUp(mouseWheelDelta)
|
||||||
if m.HighPerformanceRendering {
|
if m.HighPerformanceRendering {
|
||||||
cmd = ViewUp(m, lines)
|
cmd = ViewUp(m, lines)
|
||||||
}
|
}
|
||||||
|
|
||||||
case tea.MouseWheelDown:
|
case tea.MouseWheelDown:
|
||||||
lines := m.LineDown(3)
|
lines := m.LineDown(mouseWheelDelta)
|
||||||
if m.HighPerformanceRendering {
|
if m.HighPerformanceRendering {
|
||||||
cmd = ViewDown(m, lines)
|
cmd = ViewDown(m, lines)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user