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

LinkedEditing not work in vim #5017

Closed aispeaking closed 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-5c3bdc0 2024-05-21 17:33:35 +0800 coc.nvim directory: /home/liyt/code/extern/vim-runtime/plugged/coc.nvim term: dumb platform: linux

Log of coc.nvim

2024-05-21T19:43:14.931 INFO (pid:209402) [extension:coc-git] - Looking for git in: git 2024-05-21T19:43:14.959 WARN (pid:209402) [workspace] - Extension "undefined" registered synchronized autocmd "VimLeavePre", which could be slow. 2024-05-21T19:43:15.230 INFO (pid:209402) [plugin] - coc.nvim initialized with node: v20.12.0 after 480 2024-05-21T19:43:15.306 INFO (pid:209402) [services] - LanguageClient XML LSP state change: stopped => starting 2024-05-21T19:43:15.309 INFO (pid:209402) [language-client-index] - Language server "xml" started with 209454 2024-05-21T19:43:15.591 INFO (pid:209402) [services] - LanguageClient XML LSP state change: starting => running 2024-05-21T19:43:15.594 INFO (pid:209402) [services] - service xml started 2024-05-21T19:43:15.694 INFO (pid:209402) [attach] - receive notification: doAutocmd [ 6 ] 2024-05-21T19:43:17.503 WARN (pid:209402) [workspace] - workspace.showMessage is deprecated, please use window.showMessage instead. at Source.doComplete (/home/liyt/.config/coc/extensions/node_modules/coc-ultisnips/index.js:13:35) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 2024-05-21T19:43:17.505 ERROR (pid:209402) [provider-manager] - Provider error on provideSelectionRanges: Canceled: Canceled at LanguageClient.handleFailedRequest (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:74689:21) at /home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:69389:31 at runNextTicks (node:internal/process/task_queues:60:5) at process.processImmediate (node:internal/timers:449:9) at async Promise.allSettled (index 0) at async SelectionRangeManager.provideSelectionRanges (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:54204:23) at async Languages.getSelectionRanges (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:80962:16) at async _WordDistance.create (/home/liyt/code/extern/vim-runtime/plugged/coc.nvim/build/index.js:81186:33)

Describe the bug

LinkedEditing do not change xml tags correctly. For example:

<test></test>

When I move cursor to first 'test', both two become highlighted. Then I type cw to change the 'test' to 'text' and then type 'ESC', the result becomes

<text></te>

The issue only exist in vim, not neovim. If I type the new tag 'text' slowly, 't' 'e' 'x' 't', it is ok.

Reproduce the bug

See description. Same result with mini.vim.

Screenshots (optional)

If applicable, add screenshots to help explain your problem.

fannheyward commented 1 month ago

Thank you for your report, please try the fix on the master branch.