Closed spinningarrow closed 6 years ago
The exists test that you copied was broken, see #47 .
@spinningarrow #47 fixed a check for TextChanged
(which works awesome btw). Can you resolve and try again? Curios how the insert mode will fell
I suspect that this will be much too slow, given how long it takes for me on TextChanged.
I'm hoping to speed up the parinfer library a bunch based on advice I just read on the Vim list. (Namely, avoid for
and while
loops in favor of map
, since the former makes Vim reparse every command for every iteration.)
@eraserhd re: performance, I think the next easy step is to use the python binding in place of the VimL binding for the Parinfer algorithm. That's something we had wanted to do a while back
I'd love to use the js version, but I'm not a neovim user
@eraserhd fixed the exists
check; thanks!
I've also pushed a small fix that prevents unnecessary redrawing. Can you check and tell me if the performance feels any better?
Btw if we want to use the JS binding, would Vim8's channels/jobs feature be something that could help in that regard? https://github.com/vim/vim/blob/master/runtime/doc/version8.txt#L41
@spinningarrow cool thnx I'll this out. We could certainly use vim8's channels to send forms to a separate process running the parinfer js implementation. This would require users to have node.js installed and run an npm install
to use – not a deal breaker for me but potentially for others. Ideally we could embded v8 into vim, but that's a whole other can of works 🙃 .
I can start a branch with this idea. Would adding dependency to node.js be any issue for others?
I suppose another way is to use the JS implementation if Node is available, the Python implementation otherwise (if Vim is compiled with Python support), and if all fails fallback to the vimscript version!
trying this out...
This seems to be working for me. Can you give it a spin?