Closed eight04 closed 8 months ago
You can disable this with suggest.asciiMatch
.
After changing suggestion.asciiMatch
to false
:
I can still reproduce the issue:
It seems that this issue was caused by this commit: https://github.com/neoclide/coc.nvim/commit/9181a83f14929e7cb62069d4c61c7515e78674e4
Can we have an option to configure granularity?
I think sentence
works better with daily coding.
Yes, suggestion.asciiMatch
only control asscii input, not working on inputing Chinese character directly.
I tried replacing granularity:"word"
with granularity:"sentence"
in coc/build/index.js
but it didn't work.
It seems we also need a isWordLike
alternative. isWordLike
doesn't work with sentences.
With the following change:
Intl.Segmenter("cn",{granularity:"sentence"}).segment(n);for(let i of t)1&&(yield i.segment)
I prefer a simple configuration to disable Chinese Segments in buffer/around sources.
It seems we also need a
isWordLike
alternative.isWordLike
doesn't work with sentences.
A simpler method is to stay with granularity:"word"
but re-concat consecutive word-like segments into a single string. Then we will have the full sentence split by punctuation.
I prefer a simple configuration to disable Chinese Segments in buffer/around sources.
That should also work. It should be the old behavior before https://github.com/neoclide/coc.nvim/commit/9181a83f14929e7cb62069d4c61c7515e78674e4 right?
BTW I wonder why only Chinese got segmented. What about other languages?
why only Chinese got segmented
I remember someone mentioned this request in the Gitter chat, only Chinese sentence will be segmented to complete.
Result from CocInfo
Describe the bug
coc.nvim seems to breakup Chinese sentences into multiple words. However this is very inconvenient, we usually want to complete the entire string/item and completing a single Chinese character/word is pretty useless: In the above image,
奶油泡芙
were broken into two words奶油
and泡芙
;冰牛奶
were broken into two words冰
and牛奶
.It would make more sense to break words by whitespaces and symbols.
Reproduce the bug
We will close your issue when you don't provide minimal vimrc and we can't reproduce it
Create file
mini.vim
with:Start (neo)vim with command:
vim -u mini.vim
Paste following text:
Type
n
and see the suggestion:Screenshots (optional)
If applicable, add screenshots to help explain your problem.