Add 'plugin available' command

Closes #413
This commit is contained in:
Zachary Yedidia
2016-10-24 19:02:13 -04:00
parent c04a4ba604
commit 7492ab4de2
3 changed files with 18 additions and 1 deletions

View File

@@ -168,6 +168,15 @@ func PluginCmd(args []string) {
ToggleLog([]string{})
}
}
case "available":
packages := GetAllPluginPackages()
messenger.AddLog("Available Plugins:")
for _, pkg := range packages {
messenger.AddLog(pkg.Name)
}
if CurView().Type != vtLog {
ToggleLog([]string{})
}
}
} else {
messenger.Error("Not enough arguments")
@@ -179,6 +188,11 @@ func ToggleLog(args []string) {
if CurView().Type != vtLog {
CurView().HSplit(buffer)
CurView().Type = vtLog
RedrawAll()
buffer.Cursor.Loc = buffer.Start()
CurView().Relocate()
buffer.Cursor.Loc = buffer.End()
CurView().Relocate()
} else {
CurView().Quit(true)
}