From 1e2f99cab48f05268cb9f48e72f3cc1e9a30ce3d Mon Sep 17 00:00:00 2001 From: Hakan Baba Date: Wed, 14 Dec 2016 15:47:37 -0800 Subject: [PATCH] Fix a E121: Undefined variable: error If the exists('*exepath') evaluates to false vim was returning this error: Error detected while processing function 10_fmtAutosave..jsonnet#Format..jsonnet#CheckBinPath: line 6: E121: Undefined variable: binPath --- autoload/jsonnet.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/jsonnet.vim b/autoload/jsonnet.vim index 0821b13..ba4d725 100644 --- a/autoload/jsonnet.vim +++ b/autoload/jsonnet.vim @@ -43,8 +43,10 @@ function! jsonnet#CheckBinPath(binName) if executable(a:binName) if exists('*exepath') let binPath = exepath(a:binName) + return binPath + else + return a:binName endif - return binPath else echo "vim-jsonnet: could not find '" . a:binName . "'." return ""