diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2020-08-23 18:55:50 +0200 |
|---|---|---|
| committer | Johannes Altmanninger <aclopte@gmail.com> | 2020-08-24 19:01:05 +0200 |
| commit | 9a7d8df44732b684255acd151c4104bf95aeebd5 (patch) | |
| tree | 19c3ff9ed6bc0e88c285cc39da0b8e2f5f268d93 /rc/filetype/lua.kak | |
| parent | 4b7fd68d48061cc9c1cbf4a89ae5b2d60937f7e3 (diff) | |
Avoid accidentally using environment variables in sh scopes
On the instances with altfile this was already the case, but this makes it more obvious.
Closes #3673
Diffstat (limited to 'rc/filetype/lua.kak')
| -rw-r--r-- | rc/filetype/lua.kak | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rc/filetype/lua.kak b/rc/filetype/lua.kak index 995bd7b4..9328bc02 100644 --- a/rc/filetype/lua.kak +++ b/rc/filetype/lua.kak @@ -65,6 +65,8 @@ define-command lua-alternative-file -docstring 'Jump to the alternate file (impl [ ! -f $altfile ] && echo "fail 'implementation file not found'" && exit ;; *.lua) + altfile="" + altdir="" path=$kak_buffile dirs=$(while [ $path ]; do printf %s\\n $path; path=${path%/*}; done | tail -n +2) for dir in $dirs; do @@ -74,7 +76,7 @@ define-command lua-alternative-file -docstring 'Jump to the alternate file (impl break fi done - [ ! -d $altdir ] && echo "fail 'spec/ not found'" && exit + [ ! -d "$altdir" ] && echo "fail 'spec/ not found'" && exit ;; *) echo "fail 'alternative file not found'" && exit |
