Re: inconsistent behavior of findfunc and wildchar

17 views
Skip to first unread message

Guangxiong Lin

unread,
Sep 27, 2025, 12:16:35 AM (5 days ago) Sep 27
to vim...@googlegroups.com
I am not sure if it is posted successfully, as I cannot find it in the
google groups: <https://groups.google.com/g/vim_use>.

I created a github issue instead:
<https://github.com/vim/vim/issues/18411>.

Guangxiong Lin

unread,
Sep 27, 2025, 12:16:35 AM (5 days ago) Sep 27
to vim...@googlegroups.com
Hi,

I am recently trying the new findfunc feature. I found that the
arguments passed to findfunc was different in Linux and macOS.

For example, when I type `:find gvim ext` in cmdline, every time I
trigger `wildchar`, in macOS, findfunc receives a full list of arguments,
while in Linux, findfunc only receives the last arguments.

The minimal configuration to reproduce:

```vim
func Find(arg, _)
echom a:arg
if get(s:, 'filescache', []) == []
let s:filescache = systemlist('find . -path "*/.git" -prune -o -type f -print')
endif
return a:arg == '' ? s:filescache : matchfuzzy(s:filescache, a:arg)
endfunc
autocmd CmdlineEnter : let s:filescache = []

set wildoptions=pum
set wildmode=noselect

autocmd CmdlineChanged [:\/\?] call wildtrigger()
```

Run `:messages` after `:find gvim e`. In macOS, I got:

```
g
gv
gvi
gvim
gvim
gvim e
```

While in Linux, I got:

```
g
gv
gvi
gvim

e
```

I compiled the master branch (current commit:
<c05335082adb21d99d96374779856444a3a0688f>) in both macOS and Arch
Linux, with the following steps. (I had never compiled it myself before,
so I am not sure if it is the expected way or not.)

```bash
cd src
./configure --with-features=huge
make -j
```

I got error message `Failed to source defaults.vim` for the self
compiled vim when executing with `vim --clean`. I think it didn't affect
the behavior above.

Thanks,
Guangxiong Lin
Reply all
Reply to author
Forward
0 new messages