From dbfbe1bc6dcf6f18425a66c9c034d764030c1c8b Mon Sep 17 00:00:00 2001 From: Greg Hurrell Date: Sun, 8 Jan 2017 22:35:53 +1030 Subject: [PATCH] Replace a hard-coded list with a `keys()` call --- plugin/ferret.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/ferret.vim b/plugin/ferret.vim index f6cb192..d2e2a5a 100644 --- a/plugin/ferret.vim +++ b/plugin/ferret.vim @@ -467,8 +467,9 @@ let s:executables={ " Would ideally have these in an autoload file, but want to defer autoload " until as late as possible. function! FerretExecutable() + let l:valid=keys(s:executables) let l:executables=split(s:force, '\v\s*,\s*') - let l:executables=filter(l:executables, 'index(["rg", "ag", "ack"], v:val) != -1') + let l:executables=filter(l:executables, 'index(l:valid, v:val) != -1') if index(l:executables, 'rg') == -1 call add(l:executables, 'rg') endif