diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-18 14:52:01 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-18 14:54:05 +1000 |
commit | a1a828a781e805a8964c35305edf0365d4aa7068 (patch) | |
tree | 6aa23a0f461d3b91adc02522e51ea0c993c99714 /pkg/gui/status_panel.go | |
parent | 6b150a4be0e7712d8b8706f10bb80e34094f872b (diff) |
support opening and editing config file
Diffstat (limited to 'pkg/gui/status_panel.go')
-rw-r--r-- | pkg/gui/status_panel.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/gui/status_panel.go b/pkg/gui/status_panel.go index 67f133738..544f5e880 100644 --- a/pkg/gui/status_panel.go +++ b/pkg/gui/status_panel.go @@ -40,3 +40,24 @@ func (gui *Gui) refreshStatus(g *gocui.Gui) error { return nil } + +func (gui *Gui) renderStatusOptions(g *gocui.Gui) error { + return gui.renderOptionsMap(g, map[string]string{ + "o": gui.Tr.SLocalize("OpenConfig"), + "e": gui.Tr.SLocalize("EditConfig"), + }) +} + +func (gui *Gui) handleStatusSelect(g *gocui.Gui, v *gocui.View) error { + return gui.renderStatusOptions(g) +} + +func (gui *Gui) handleOpenConfig(g *gocui.Gui, v *gocui.View) error { + filename := gui.Config.GetUserConfig().ConfigFileUsed() + return gui.genericFileOpen(g, v, filename, gui.OSCommand.OpenFile) +} + +func (gui *Gui) handleEditConfig(g *gocui.Gui, v *gocui.View) error { + filename := gui.Config.GetUserConfig().ConfigFileUsed() + return gui.genericFileOpen(g, v, filename, gui.OSCommand.EditFile) +} |