Closed kuuote closed 1 year ago
onCompleteDone is delayed when show new menu after typing with a word inserted.
Always call onCompleteDone immediately.
onCompleteDone
pum.vim version(SHA1): b05f66c72c536a7943a6ada72563be9cb7251ed3
ddc.vim version(SHA1): 4ea5dc5a0c181a65e58b460d6f2d4e0e21616950
OS: Arch Linux
neovim/Vim :version output:
:version
NVIM v0.10.0-dev-575+ge59cf3b3a-dirty Build type: Debug LuaJIT 2.1.0-beta3 Compilation: /usr/bin/cc -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wimplicit-fallthrough -fdiagnostics-color=auto -fstack-protector-strong -DNVIM_LOG_DEBUG -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_TS_HAS_SET_MAX_START_DEPTH -I/data/builder/src/neovim/src/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/data/builder/src/neovim/src/neovim/.deps/usr/include -I/data/builder/src/neovim/src/neovim/build/src/nvim/auto -I/data/builder/src/neovim/src/neovim/build/include -I/data/builder/src/neovim/src/neovim/build/cmake.config -I/data/builder/src/neovim/src/neovim/src system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/local/share/nvim" Run :checkhealth for more info
set rtp+=/path/to/vim-denops/denops.vim set rtp+=/path/to/Shougo/ddc.vim set rtp+=/path/to/Shougo/ddc-ui-native set rtp+=/path/to/Shougo/ddc-ui-pum set rtp+=/path/to/Shougo/pum.vim set noshowmode call ddc#enable() call ddc#register('source', expand('<sfile>:h') .. '/a.ts') call ddc#custom#patch_global('ui', 'pum') call ddc#custom#patch_global('sources', ['a']) inoremap <C-n> <Cmd>call pum#map#insert_relative(+1)<CR> inoremap <C-y> <Cmd>call pum#map#confirm()<CR>
and place this source to same directory of init.vim named "a.ts"
import { BaseSource } from "https://deno.land/x/ddc_vim@v3.2.0/types.ts"; type Params = Record<never, never>; export class Source extends BaseSource<Params> { override async gather() { return [{ word: "hoge", user_data: {}, }]; } override async onCompleteDone() { console.log(Math.random()); } override params() { return {}; } }
nvim -u init.vim
<C-n>
Not called at this timing and delayed until time to close menu.
Fixed.
Problems summary
onCompleteDone is delayed when show new menu after typing with a word inserted.
Expected
Always call
onCompleteDone
immediately.Environment Information (Required!)
pum.vim version(SHA1): b05f66c72c536a7943a6ada72563be9cb7251ed3
ddc.vim version(SHA1): 4ea5dc5a0c181a65e58b460d6f2d4e0e21616950
OS: Arch Linux
neovim/Vim
:version
output:Provide a minimal init.vim/vimrc without plugin managers (Required!)
and place this source to same directory of init.vim named "a.ts"
How to reproduce the problem from neovim/Vim startup (Required!)
nvim -u init.vim
.<C-n>
)Not called at this timing and delayed until time to close menu.