I'm not sure if I did something wrong, but every time I try to generate the TOC or run :UpdateToc, I am getting this error:
The TOC is still getting generated correctly, just this error appears. I am using silent! now to ignore the error. Any thoughts?
Thanks for reporting.
I can't reproduct this error in lastest version of Vim or NeoVim. Would you please provide me your NeoVim version and one demo file with this error appears? Thanks a lot!
BTW: It seems that error may appears in some versions of Vim/NeoVim sometimes, see neovim/neovim#2600
I'm using NVIM 0.2.0-dev.
<!-- vim-markdown-toc GFM -->
* [Another Tests](#another-tests)
<!-- vim-markdown-toc -->
## Another Tests
Using :UpdateToc results in 2 range errors, one for each headline
Fix #19, compatible with settings `regexpengine=1`
I've checked over your dotfiles, and do some test with it, finally found that it caused by set re=1 in https://github.com/dvcrn/dotfiles/blob/master/vim/style.vim#L27. The following line in my code does not compatible with old regexp engine.
let l:headingLink = substitute(l:headingLink, "[^[:alnum:]\u4e00-\u9fbf _-]", "", "g")
Seems old regexp engine cannot handle range \u4e00-\u9fbf, so I changed my code to let this substitute force automatic selection regexp engine. It works on my nvim 0.2.0-dev under Ubuntu with your dotfiles.
Please update the plugin and try again, feedbacks are welcome.
BTW: What makes you to set re=1? The new regexp engine would provide better performance in most cases. I think keep default configuration for this is good enough. For more details by command :h regexpengine and :h two-engines.
Oh that was fast, thank you! Going through my dotfiles is definitely not something every project maintainer would do!
I am setting set re=1 because of what the comment above it says:
" trial & error. These 3 lines seem to cause most of the performance problems I
" was experiencing. Adding these here reduces most of that rendering lag.
I was experiencing very annoying rendering lag and adding these 3 lines seemed to get rid of it. Since then I just left the settings in my config and didn't touch them
You are welcome! Hope your problem is resolved.