mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 06:04:18 +00:00
Fix cursor placement when paging trough filtered notes
This commit is contained in:
parent
fbe93a90ff
commit
7fb4a43474
1 changed files with 13 additions and 0 deletions
13
ui/stash.go
13
ui/stash.go
|
@ -661,6 +661,19 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
|
|||
break
|
||||
}
|
||||
|
||||
// When there's only one filtered markdown left and the cursor
|
||||
// is placed on it we can diretly "enter" it and change to the
|
||||
// markdown view
|
||||
if h := m.getNotes(); len(h) == 1 && h[0].ID == m.selectedMarkdown().ID {
|
||||
m.state = stashStateReady
|
||||
m.searchInput.Reset()
|
||||
|
||||
var cmd tea.Cmd
|
||||
m, cmd = stashUpdate(msg, m)
|
||||
cmds = append(cmds, cmd)
|
||||
break
|
||||
}
|
||||
|
||||
m.searchInput.Blur()
|
||||
|
||||
m.state = stashStateShowFiltered
|
||||
|
|
Loading…
Reference in a new issue