mirror of
https://github.com/charmbracelet/glow
synced 2024-10-04 15:09:09 +00:00
Pass through all keys when editing filter
This commit is contained in:
parent
a5d4a512b7
commit
cfb746e66a
6
ui/ui.go
6
ui/ui.go
|
@ -254,6 +254,11 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
// Send q/esc through to stash
|
// Send q/esc through to stash
|
||||||
switch m.state {
|
switch m.state {
|
||||||
case stateShowStash:
|
case stateShowStash:
|
||||||
|
// pass through all keys if we're editing the filter
|
||||||
|
if m.stash.filterState == filtering {
|
||||||
|
m.stash, cmd = m.stash.update(msg)
|
||||||
|
return m, cmd
|
||||||
|
}
|
||||||
|
|
||||||
// Q quits if we're filtering, but we still send esc though.
|
// Q quits if we're filtering, but we still send esc though.
|
||||||
if m.stash.filterApplied() {
|
if m.stash.filterApplied() {
|
||||||
|
@ -267,7 +272,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
// Send q/esc through in these cases
|
// Send q/esc through in these cases
|
||||||
switch m.stash.viewState {
|
switch m.stash.viewState {
|
||||||
case stashStateReady:
|
case stashStateReady:
|
||||||
|
|
||||||
// Q also quits glow when displaying only newsitems. Esc
|
// Q also quits glow when displaying only newsitems. Esc
|
||||||
// still passes through.
|
// still passes through.
|
||||||
if msg.String() == "q" {
|
if msg.String() == "q" {
|
||||||
|
|
Loading…
Reference in a new issue