Fix: check for utilization of legacy regexpengine by winsbe01 · Pull Request #1479 · vimwiki/vimwiki
Steps for submitting a pull request:
- ALL pull requests should be made against the
devbranch! - Take a look at CONTRIBUTING.MD
- Reference any related issues.
- Provide a description of the proposed changes.
- PRs must pass Vint tests and add new Vader tests as applicable.
- Make sure to update the documentation in
doc/vimwiki.txtif applicable,
including the Changelog and Contributors sections.
This fixes a bug where vimwiki was throwing an E945: Range too large in character class when trying to follow a link to a header anchor in Markdown (or, theoretically, anywhere that tries to normalize an anchor). The root of the problem seems to be the get_punctuation_regex(), which for newer versions of vim (>7.03) includes the CJK Unified Ideographs unicode block (u4300-u9fff). Starting with vim 7.04, a new regular expression engine is available in vim, which allows for wider ranges of characters than the original one (only 256). The check in this function assumes that the user either has the new engine enabled ( set regexpengine=2), or has the "pick for me at runtime based on my regex" option enabled (set regexpengine=0). This error arises specifically when the version of vim is 7.04+ and the option is set regexpengine=1.
FWIW, I discovered this problem on a Mac running vim 9.x (can't remember the minor at the moment), and it seems like set regexpengine=1 may be the default on the version of vim that is shipped with the Mac. I say this because I have never manually set this option (I didn't even know it was a thing until digging in here), my vimrc is smallish (40 lines with spaces and comments) and I share it between Mac and Linux (I don't have this problem on Linux unless I manually change the regexpengine), and I have no other vim plugins installed besides vimwiki.
This may be the root cause behind issues #1002 and/or #1386.