parinfer

chrisoakman 2018-11-23T04:00:07.056400Z

"I don’t know how to make vscode defer rendering until the whole operation is done" --> this is the exact same problem I ran into here: https://github.com/shaunlebron/vscode-parinfer/pull/39

chrisoakman 2018-11-23T04:02:09.058100Z

I think we need to reach out to the VSCode team for help with their API. They made an exception for the vim extension; I suspect we could get a similar arrangement.

pez 2018-11-23T06:25:06.061700Z

I’m not where I have that problem yet. 😃 First I need to figure out how to use the parenMode and smartMode functions.

pez 2018-11-23T08:43:08.063100Z

Found my error. :canges is plural.

pez 2018-11-23T10:13:12.065900Z

The docs says: Process the text after a change OR a cursor movement. Might be because I have quite high fever today, but I don’t really understand why the text should be processed on cursor movement if it is processed on changes. Let me know, please, someone. Speak to me like I am five yo. 🙂

shaunlebron 2018-11-23T16:23:44.067Z

parinfer relaxes rules around the cursor, so it needs to know when its position changes

pez 2018-11-23T17:29:14.070200Z

Hmmm. But we give it the previous and current position when we use it. And the functions are pure, right? I found that it will be a bit too much work for me right now to process text on changes, because vscode has limted API:s there, So I am rather considering to process text mainly on cursor movement, but I want to better understand what is going on, so that’s why I ask about it.

shaunlebron 2018-11-23T20:43:46.071500Z

in that case it’s fine to skip the cursor event

shaunlebron 2018-11-23T20:44:25.072300Z

same thing should happen after the next change event since you pass it the cursor everytime anyway, like you said 👍

1🤘
eraserhd 2018-11-23T23:37:11.074300Z

So, in implementing parinfer-rust for Kakoune, one issue is that Kakoune natively relies on having multiple cursors (you can't search and replace without multiple cursors, for example). I'll need to add this to parinfer-rust, and I hope to also add it to parinfer just to keep them in sync as much as possible. Have any other editors needed or wanted this? Any pitfalls I should worry about?

eraserhd 2018-11-23T23:39:04.075900Z

One problem is that cursors don't have unique identifiers, so matching previous cursor position to current cursor positions seems difficult. I know how to solve matching problems 😄 But I'll have to figure out what happens when a cursor disappears or appears.