hrsh7th / cmp-cmdline

nvim-cmp source for vim's cmdline
MIT License
547 stars 42 forks source link

Regex issue in COUNT_RANGE_REGEX #71

Open ralphie02 opened 1 year ago

ralphie02 commented 1 year ago

I am currently getting the error below

E5113: Error while calling lua chunk: ...e/pack/packer/start/cmp-cmdline/lua/cmp_cmdline/init.lua:35: couldn't parse regex: Vim:E369: invalid item in \%[]
stack traceback:
        [C]: in function 'create_regex'
        ...e/pack/packer/start/cmp-cmdline/lua/cmp_cmdline/init.lua:35: in main chunk
        [C]: in function 'require'

and it seems to have been caused by the changes in Lines 32:33 in here: https://github.com/hrsh7th/cmp-cmdline/commit/79456dc113afe8420e08e31f0bb55dfe0eb45903#diff-e81aca883917fc785881d0e95f858279133a06b96780f2aac5e1929f85fe1484R33

I've restored things for now in my local machine and the error is no longer there.

obmutescences commented 1 year ago

any progress for this issue?

hrsh7th commented 1 year ago

I can't reproduce... How to reproduce this problem?

IanMejia commented 1 year ago

I can't reproduce...

How to reproduce this problem?

Odd that you cannot reproduce it, neovim's docs referencing the usage of \%[] says it cannot include a \%(\) within. The change that @ralphie02 mentions shouldn't even work in the first place. The part that's weird, is that the pattern as a whole does work in matching the characters *]=] which probably means that it ignores everything else.

alexhokl commented 1 year ago

Commenting out https://github.com/hrsh7th/cmp-cmdline/blob/main/lua/cmp_cmdline/init.lua#L36 can avoid the error message temporarily.

mfilej commented 1 year ago

Can confirm that this issue is still happening just by installing the plugin. I tried commenting out all cmp-related configuration. I get the same error as described in the first post.

:version
NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Ventura-arm64.local

Features: +acl +iconv +tui
See ":help feature-compile"

edit: I should add that I worked around the issue by pinning the plugin to commit e1ba818534a357b77494597469c85030c7233c16.

antenore commented 1 year ago

Any news about this issue? I have the same issue... Sticking to commit e1ba818534a357b77494597469c85030c7233c16

ralphie02 commented 1 year ago

I recently updated my vim plugins and it seems like this is related to telescope plugin.

@hrsh7th If you currently don't have telescope installed, can you try and install it and see if you can reproduce the issue? A lot of people use that plugin so people will probably appreciate a proper fix 🙏