vim --cleanvim9script
set completeopt=menu,popup,fuzzy
set wildmenu wildoptions=pum,fuzzy pumheight=12
var files_cache: list<dict<any>> = []
augroup CmdCompleteResetFind
au!
au CmdlineEnter : files_cache = []
augroup END
def Find(cmd_arg: string, _): list<dict<any>>
if empty(files_cache)
files_cache = globpath('.', '**', 1, 1)
->filter((_, v) => !isdirectory(v))
->mapnew((_, v) => {
return {
word: v->substitute('^\.[\/]', "", ""),
info: $"{getfperm(v)} {strftime("%Y-%m-%d %H:%M:%S", getftime(v))}"}
})
endif
if empty(cmd_arg)
return files_cache
else
return files_cache->matchfuzzy(cmd_arg, {key: "word"})
endif
enddef
set findfunc=Find
:cd some-non-home-dir:find <tab> see the pmenu with info popups<CR> to select and open the fileSelected file should be opened in vim. Nothing happens instead.
@zeertzjq fyi
It still works if function returns list of strings.
9.2.452
debian13, bash
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
https://asciinema.org/a/NKOENFuXUm0NuNiL
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
You can only return a list of dicts for cmdline completion. Otherwise it's not allowed.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Wait
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
You can only return a list of dicts for cmdline completion. Otherwise it's not allowed. There should be an error.
well, it works for list of strings (as it should for backward compatibility) and it doesn't work for the list of dicts as in my example.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Wait, I thought there was an error for having non-strings in the list. It turns out there wasn't. In that case this should be supported.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Wait, I thought there was an error for having non-strings in the list. It turns out there wasn't. In that case this should be supported.
There is no error and it works fine up until I try execute :find command with completed item -- it does nothing.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()