]> git.lizzy.rs Git - micro.git/commitdiff
Don't throw error if job callback doesn't exist
authorZachary Yedidia <zyedidia@gmail.com>
Sun, 21 Jan 2018 21:31:13 +0000 (16:31 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Sun, 21 Jan 2018 21:31:13 +0000 (16:31 -0500)
Closes #953

cmd/micro/plugin.go

index 4248132dc1057c4bc6706219ea1bdd46be0950e9..b335078070ba02a4bb7471efe5b276c9d0061f16 100644 (file)
@@ -124,7 +124,7 @@ func LuaFunctionComplete(function string) func(string) []string {
 func LuaFunctionJob(function string) func(string, ...string) {
        return func(output string, args ...string) {
                _, err := Call(function, unpack(append([]string{output}, args...))...)
-               if err != nil {
+               if err != nil && !strings.HasPrefix(err.Error(), "function does not exist") {
                        TermMessage(err)
                }
        }