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

Support multibye charactor / unicode #18

Open
tkkcc opened this issue Dec 8, 2021 · 2 comments
Open

Support multibye charactor / unicode #18

tkkcc opened this issue Dec 8, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tkkcc
Copy link

tkkcc commented Dec 8, 2021

Hi,

It seems this plugin doesn't support multibyte charactor, for example 图片。I tried modifying

function source:get_keyword_pattern()
  return [[\w\+]]
end

to [[\k\+]], but failed.

Currently, multibyte charactor is support in buffer source using

sources = cmp.config.sources({
  {name = 'snippy'}, {name = 'nvim_lsp'},
  {name = 'buffer', option = { keyword_pattern = [[\k\+]]}},
  {name = 'path'},
  {name = 'tmux'},
}),
@andersevenrud
Copy link
Owner

Sorry for the late reply. I've been really busy all day 😅

Thanks. I'll do some investigation on this.

@andersevenrud andersevenrud added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Dec 8, 2021
@andersevenrud
Copy link
Owner

I figured out that this is a problem because of the internal Lua string matching functionality.

This can be solved by tapping into the Neovim multibyte APIs. Gotta do a bit of research on that and I'll open a PR with a solution to test.

@andersevenrud andersevenrud self-assigned this Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants