|
|
@@ -537,6 +537,8 @@ func (i Issue) update(msg tea.Msg) (widget, tea.Cmd) {
|
|
|
switch msg.String() {
|
|
|
case "e":
|
|
|
cmds = append(cmds, i.edit)
|
|
|
+ case "esc":
|
|
|
+ cmds = append(cmds, i.back)
|
|
|
}
|
|
|
}
|
|
|
return i, tea.Batch(cmds...)
|
|
|
@@ -544,6 +546,15 @@ func (i Issue) update(msg tea.Msg) (widget, tea.Cmd) {
|
|
|
|
|
|
func (i Issue) edit() tea.Msg { return newEditWidget(i.Path) }
|
|
|
|
|
|
+func (i Issue) back() tea.Msg {
|
|
|
+ remainder, _ := filepath.Split(i.Path)
|
|
|
+ remainder = strings.TrimRight(remainder, "/")
|
|
|
+ if len(remainder) == 0 {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ return loadPath(remainder)
|
|
|
+}
|
|
|
+
|
|
|
// render cmd for Issue widget
|
|
|
func (i Issue) render() tea.Msg {
|
|
|
var output string
|
|
|
@@ -586,7 +597,12 @@ func (i Issue) render() tea.Msg {
|
|
|
// keyhelp cmd for Issue widget
|
|
|
func (i Issue) keyhelp() string {
|
|
|
var output string
|
|
|
- output = output + "\ne: edit issue\t\tctrl+c: quit"
|
|
|
+ var escStr string
|
|
|
+ remainder, _ := filepath.Split(i.Path)
|
|
|
+ if IsIssueCollection(remainder) {
|
|
|
+ escStr = "\t\tesc: back"
|
|
|
+ }
|
|
|
+ output = output + fmt.Sprintf("\ne: edit issue%s\t\tctrl+c: quit", escStr)
|
|
|
return output
|
|
|
}
|
|
|
|