mirror of
https://github.com/charmbracelet/gum
synced 2024-06-09 01:02:17 +02:00
chore: Linter issues
This commit is contained in:
parent
ae1b75807d
commit
8e5e39ef26
|
@ -86,7 +86,7 @@ func (m *model) ProcessText(msg tea.WindowSizeMsg) {
|
|||
|
||||
func (m model) KeyHandler(key tea.KeyMsg) (model, func() tea.Msg) {
|
||||
var cmd tea.Cmd
|
||||
const HEIGHT_OFFSET = 2
|
||||
const HeightOffset = 2
|
||||
if m.search.active {
|
||||
switch key.String() {
|
||||
case "enter":
|
||||
|
@ -96,7 +96,7 @@ func (m model) KeyHandler(key tea.KeyMsg) (model, func() tea.Msg) {
|
|||
|
||||
// Trigger a view update to highlight the found matches.
|
||||
m.search.NextMatch(&m)
|
||||
m.ProcessText(tea.WindowSizeMsg{Height: m.viewport.Height + HEIGHT_OFFSET, Width: m.viewport.Width})
|
||||
m.ProcessText(tea.WindowSizeMsg{Height: m.viewport.Height + HeightOffset, Width: m.viewport.Width})
|
||||
} else {
|
||||
m.search.Done()
|
||||
}
|
||||
|
@ -115,10 +115,10 @@ func (m model) KeyHandler(key tea.KeyMsg) (model, func() tea.Msg) {
|
|||
m.search.Begin()
|
||||
case "p", "N":
|
||||
m.search.PrevMatch(&m)
|
||||
m.ProcessText(tea.WindowSizeMsg{Height: m.viewport.Height + HEIGHT_OFFSET, Width: m.viewport.Width})
|
||||
m.ProcessText(tea.WindowSizeMsg{Height: m.viewport.Height + HeightOffset, Width: m.viewport.Width})
|
||||
case "n":
|
||||
m.search.NextMatch(&m)
|
||||
m.ProcessText(tea.WindowSizeMsg{Height: m.viewport.Height + HEIGHT_OFFSET, Width: m.viewport.Width})
|
||||
m.ProcessText(tea.WindowSizeMsg{Height: m.viewport.Height + HeightOffset, Width: m.viewport.Width})
|
||||
case "q", "ctrl+c", "esc":
|
||||
return m, tea.Quit
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue