mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
add open/close in bug view
This commit is contained in:
parent
b5025a51a2
commit
f262a01b1f
@ -94,7 +94,7 @@ func (sb *showBug) layout(g *gocui.Gui) error {
|
||||
}
|
||||
|
||||
v.Clear()
|
||||
fmt.Fprintf(v, "[q] Save and return [←↓↑→,hjkl] Navigation ")
|
||||
fmt.Fprintf(v, "[q] Save and return [←↓↑→,hjkl] Navigation [o] Toggle open/close ")
|
||||
|
||||
if sb.isOnSide {
|
||||
fmt.Fprint(v, "[a] Add label [r] Remove label")
|
||||
@ -171,6 +171,12 @@ func (sb *showBug) keybindings(g *gocui.Gui) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Open/close
|
||||
if err := g.SetKeybinding(showBugView, 'o', gocui.ModNone,
|
||||
sb.toggleOpenClose); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Title
|
||||
if err := g.SetKeybinding(showBugView, 't', gocui.ModNone,
|
||||
sb.setTitle); err != nil {
|
||||
@ -603,6 +609,14 @@ func (sb *showBug) setTitle(g *gocui.Gui, v *gocui.View) error {
|
||||
return setTitleWithEditor(sb.bug)
|
||||
}
|
||||
|
||||
func (sb *showBug) toggleOpenClose(g *gocui.Gui, v *gocui.View) error {
|
||||
if sb.bug.Snapshot().Status.String() == "open" {
|
||||
return sb.bug.Close()
|
||||
} else {
|
||||
return sb.bug.Open()
|
||||
}
|
||||
}
|
||||
|
||||
func (sb *showBug) addLabel(g *gocui.Gui, v *gocui.View) error {
|
||||
c := ui.inputPopup.Activate("Add labels")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user