Fork me on GitHub

Still can't understand the how things work in parinfer.js, so I wrote with my own understanding of what it should be. Now trying to find the solution for best performance, hope to be available soon.


@doglooksgood That’s a whole rewrite of smart mode?


yes, whole rewrite.


I decide to have only smart mode. no custom options. @cfleming


Sounds good - I’ll be doing that in Cursive too. Make sure you check out the test cases though, there are lots of corner cases and Shaun put a lot of work into dealing with them.


I mean, I’ll only be having Smart Mode, not that I’ll be rewriting parinfer too.


@cfleming I'm stuck with the perf issue, emacs has some built-in support for query syntax of code. I use them to get some information like "whether the cursor is on comment or not?", instead of parse the code in string. but I found it is likely slower. Is cursive try to keep logic as the same as parinfer.js or write its own?


and I hope there's a post on how parinfer works, like in its homepage. 1 we remove the unstable close paren, 2 we insert the close paren according to the openers and indentation. obviously, this is a brief and the real is not simple like this. but I want a article for the rule of smart mode and the flow of how it works.


@doglooksgood Yes, Cursive uses a port of parinfer.js to Kotlin (based on parinfer-jvm, but my version is quite different from that now).


So when Shaun makes a fix I just port it over.


I think it's pretty hard to make a perf good. 😢


maybe my implementation is too naive.