Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed open exsit file with list in vim #5011

Open
aispeaking opened this issue May 16, 2024 · 5 comments · Fixed by #5016
Open

Failed open exsit file with list in vim #5011

aispeaking opened this issue May 16, 2024 · 5 comments · Fixed by #5016

Comments

@aispeaking
Copy link
Contributor

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
Copy link
Contributor Author

@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
Copy link
Member

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
Copy link
Contributor Author

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

@fannheyward
Copy link
Member

Reproduced with vim

@fannheyward fannheyward reopened this May 23, 2024
@fannheyward
Copy link
Member

The #5016 fix has been reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants