neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.38k stars 954 forks source link

Confirming completion deletes next word #4701

Closed uranium11010 closed 1 year ago

uranium11010 commented 1 year ago

Result from CocInfo

## versions

vim version: NVIM v0.5.0
node version: v17.9.1
coc.nvim version: 0.0.82-48001524 2022-12-23 11:32:14 +0800
coc.nvim directory: /afs/csail.mit.edu/u/z/zli11010/.local/share/nvim/plugged/coc.nvim
term: tmux
platform: linux

## Log of coc.nvim

2023-07-12T18:50:11.621 INFO (pid:2519281) [attach] - receive notification: highlight []
2023-07-12T18:50:11.705 INFO (pid:2519281) [plugin] - coc.nvim initialized with node: v17.9.1 after 304

Describe the bug

For some language servers, confirming a completion deletes the next word if there's no space between the cursor and the next word.

Reproduce the bug

I will use jedi-language-server as an example, but I've experienced the issue with e.g. coc-json as well.

Expected behavior

The word following the cursor should not disappear when I accept an autocomplete suggestion. Or, if this was intended behavior, then it would be great if there was a way to disable this behavior. (I tried to find how to disable it but was unsuccessful.)

Screenshots

For example, suppose I have a function and am calling the function, but I later realized I want to pass an additional keyword argument, like so:

image

Upon confirming the selected autocomplete suggestion, more_args disappeared:

image
uranium11010 commented 1 year ago

I figured it out: simply set suggest.insertMode to insert in coc-settings.json. Thanks!