neoclide / coc.nvim

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

Failed open exsit file with list in vim #5011

Open aispeaking opened 1 month ago

aispeaking commented 1 month ago

Result from CocInfo

versions

vim version: VIM - Vi IMproved 9.0 9001563 node version: v20.12.0 coc.nvim version: 0.0.82-2c7e715 2024-05-15 09:42:33 +0800 coc.nvim directory: /home/liyt/code/extern/vim-runtime/plugged/coc.nvim term: dumb platform: linux

Log of coc.nvim

2024-05-16T17:27:00.387 INFO (pid:119144) [extension:coc-git] - Looking for git in: git 2024-05-16T17:27:00.412 WARN (pid:119144) [workspace] - Extension "undefined" registered synchronized autocmd "VimLeavePre", which could be slow. 2024-05-16T17:27:00.664 INFO (pid:119144) [plugin] - coc.nvim initialized with node: v20.12.0 after 457 2024-05-16T17:27:02.668 INFO (pid:119144) [attach] - receive notification: openList [ 'mru' ] 2024-05-16T17:27:02.699 INFO (pid:119144) [attach] - receive notification: doAutocmd [ 2, 2 ] 2024-05-16T17:27:03.866 INFO (pid:119144) [attach] - receive notification: doAutocmd [ 2, 1 ] 2024-05-16T17:27:03.866 INFO (pid:119144) [attach] - receive notification: doAutocmd [ 3, 1 ] 2024-05-16T17:27:06.902 ERROR (pid:119144) [node-client] - request error on "nvim_call_function" [ 'coc#util#jump', [ 'edit', '/home/liyt/code/test/tcp_close/main.cpp', null ] ] Error: request error on "nvim_call_function" - Vim(edit):E325: ATTENTION on api "call_function" ["coc#util#jump",["edit","/home/liyt/code/test/tcp_close/main.cpp",null]] at Files.jumpTo (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:44963:29) at Workspace.jumpTo (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:48033:27) at MruList.jumpTo (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:66215:33) at async Object.execute (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:66189:15) at async ListSession.doItemAction (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:68526:13) at async ListSession.doAction (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:68255:27) at async ListManager.doAction (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:75999:9) at async /home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:66612:11 2024-05-16T17:27:06.903 ERROR (pid:119144) [events] - Error on event: InputChar Error: request error on "nvim_call_function" - Vim(edit):E325: ATTENTION on api "call_function" ["coc#util#jump",["edit","/home/liyt/code/test/tcp_close/main.cpp",null]] at Files.jumpTo (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:44963:29) at Workspace.jumpTo (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:48033:27) at MruList.jumpTo (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:66215:33) at async Object.execute (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:66189:15) at async ListSession.doItemAction (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:68526:13) at async ListSession.doAction (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:68255:27) at async ListManager.doAction (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:75999:9) at async /home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:66612:11

Describe the bug

When a file is already opened in other vim instance, open that file in lists (files, grep, coc-explorer) will fail: A prompt ask for action "Open Read-Only......", I choose Open Read-Only, Then the buffer window is empty without any text.

Only occurs in vim, neovim is fine.

Reproduce the bug

vim anyfile.txt

make vim backgroud. vim CocList files, select anyfile.txt and open, choose "Open Read-Only" if asked. Then buffer window is open and no text in it. **Same result with mini.vim** ## Screenshots (optional) If applicable, add screenshots to help explain your problem.
aispeaking commented 1 month ago

@fannheyward After this fix, the CocList grep -e is broken. It always jumps to the first line location of the file when first open. And the following jumps in that file are correct.

fannheyward commented 1 month ago

always jumps to the first line location of the file when first open

@aispeaking I can't reproduce this, use <CR> in insert mode or o in normal mode to open any file, will jump to the correct place, neither first open or not.

aispeaking commented 1 month ago

@fannheyward Do you use vim? It is still a vim specific issue.

fannheyward commented 1 month ago

Reproduced with vim

fannheyward commented 1 month ago

The #5016 fix has been reverted.