autoload/plugins/regex.vim
¶
Enforce vim script implementation to reduce ambiguities and improve robustness:
scriptversion 4
- lang_complete(arglead: str, cmdline: str, cursorpos: int) List[str] ¶
Completion targets for usable
:Regex
modes.- Parameters
arglead – Text of argument being completed
cmdline – Text of the command line
cursorpos – Location within command line
- Returns
Completion candidates
function! plugins#regex#lang_complete(arglead, cmdline, cursorpos) abort
const l:lang_files = glob(
\ g:dein_repos_dir ..
\ '/github.com/ervandew/regex/autoload/regex/lang/*.vim',
\ v:false, v:true
\ )
const l:supported_langs = filter(
\ mapnew(l:lang_files, {_, s -> fnamemodify(s, ':t:r')}),
\ {_, s -> !empty(exepath(s))}
\ )
return sort(filter(l:supported_langs,
\ {_, s -> s =~? '^' .. a:arglead}))
endfunction