diff options
author | Michał Górny <mgorny@gentoo.org> | 2022-01-26 10:59:01 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-02-03 09:36:48 +0100 |
commit | e792576ae2be0ea2ef5adf29876369f69876be9b (patch) | |
tree | b3bfd62f2e7b91f727a6c4ecb51eff7e5aa30a4d | |
parent | gentoo-common: Remove unnecessary continue (diff) | |
download | gentoo-syntax-e792576ae2be0ea2ef5adf29876369f69876be9b.tar.gz gentoo-syntax-e792576ae2be0ea2ef5adf29876369f69876be9b.tar.bz2 gentoo-syntax-e792576ae2be0ea2ef5adf29876369f69876be9b.zip |
gentoo-common: Simplify adding other impls
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r-- | plugin/gentoo-common.vim | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/plugin/gentoo-common.vim b/plugin/gentoo-common.vim index 4c4c152..671a3c5 100644 --- a/plugin/gentoo-common.vim +++ b/plugin/gentoo-common.vim @@ -67,17 +67,16 @@ fun! GentooGetPythonTargets() if filereadable(l:pyexec_path) let l:pys = readfile(l:pyexec_path)->filter("v:val =~ '^[^#-]'") \ ->sort() + let l:impls = [] let l:py3s = [] - let l:others = [] for l:py in l:pys let l:m = l:py->matchstr("^python3.*")->matchstr("\\d*$") if !empty(l:m) eval l:py3s->add(l:m) else - eval l:others->add(l:py) + eval l:impls->add(l:py) endif endfor - let l:impls = [] if len(l:py3s) ==# 1 let l:impls = l:impls->add("python3_".l:py3s->join()) elseif len(l:py3s) > 1 @@ -104,7 +103,7 @@ fun! GentooGetPythonTargets() \ ->join(",")."}") endif endif - let l:py3 = flatten(l:impls->add(l:others))->join() + let l:py3 = flatten(l:impls)->join() endif if empty(l:py3) let l:py3 = |