You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
here is such case,I wanner run a sub tea program in a main tea program, they are binding the same keys, how can i isolate the msg, when I run sub tea program, I just want to sub program receive the msg, but in fact, when I quit sub program, the main program also receive the msgs
Pager is sub tea program, it also binding ctrl+c etc...
// main model (bubble table)Update funcfunc (tTable) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
varcmd tea.Cmdswitchmsg:=msg.(type) {
case tea.KeyMsg:
switchmsg.String() {
case"esc":
ift.table.Focused() {
t.table.Blur()
} else {
t.table.Focus()
}
case"q", "ctrl+c":
returnt, tea.Quitcase"v":
if_issue, err:=issue.Detail(t.Enterprise.Id, t.table.SelectedRow()[0]); err==nil {
// sub program, when I press "q", sometimes, it will be received by the main programNewPager(_issue.Title, _issue.Description, Markdown).Run()
} else {
returnt, tea.Quit
}
}
}
t.table, cmd=t.table.Update(msg)
returnt, cmd
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi
here is such case,I wanner run a sub tea program in a main tea program, they are binding the same keys, how can i isolate the msg, when I run sub tea program, I just want to sub program receive the msg, but in fact, when I quit sub program, the main program also receive the msgs
Pager is sub tea program, it also binding ctrl+c etc...
Beta Was this translation helpful? Give feedback.
All reactions