chrisgrieser / nvim-rip-substitute

Perform search and replace operations in the current buffer using a modern user interface and contemporary regex syntax.
MIT License
127 stars 7 forks source link

Bug: Handle `rg` installations not being built with pcre2 supports #3

Closed niuiic closed 1 month ago

niuiic commented 1 month ago

Make sure you have done the following

Bug Description

Required feature pcre2 is not included in the ripgrep installed with cargo.

You may add this to the document, or maybe we can make this optional.

cargo install ripgrep --features 'pcre2'

Relevant Screenshot

No response

To Reproduce

x

neovim version

0.10.0
chrisgrieser commented 1 month ago

I see, wasn't aware that rg does not always ship with pcre2 support. Do you by any chance know if there is a way to tell from an rg installation whether pcre2 is available? Ideally, I'd like to automatically detect whether to turn on pcre2 or not.

niuiic commented 1 month ago

Error msg from rg command told me this feature is missing. I just debuged the source code, and see this.

chrisgrieser commented 1 month ago

Found this in the man page:

   --pcre2-version
     When this flag is present, ripgrep will print the version of PCRE2 in use, along with other
     information, and then exit. If PCRE2 is not available, then ripgrep will print an error message
     and exit with an error code.

Could you, just to be sure, tell me what rg --pcre2-version outputs on your system where rg has not pcre2 included?

niuiic commented 1 month ago

PCRE2 is not available in this build of ripgrep

chrisgrieser commented 1 month ago

Got it, added some validation that automatically disables pcre2 if using a rg version without it, and also added some information to the readme