parinfer-rust
parinfer-rust copied to clipboard
Wonky cursor positions?
I'd love some help with this. I'm probably calculating my offsets wrong or something, but I'm not quite sure what I'm doing wrong.
Args:
{
"mode": "smart",
"text": "[1 \n2]",
"options": {
"prevText": "[1 2]",
"prevCursorLine": 0,
"prevCursorX": 3,
"cursorLine": 1,
"cursorX": 0
}
}
Output:
{
"text": "[1] \n2",
"success": true,
"error": null,
"cursorX": 0,
"cursorLine": 1,
"tabStops": [
{
"ch": "[",
"x": 0,
"lineNo": 0,
"argX": 3
}
],
"parenTrails": [
{
"lineNo": 0,
"startX": 2,
"endX": 3
}
],
"parens": []
}
(I'm using WASM)
Hi!
It's been a while since I've had this loaded into my brain, but as far as I can tell, you are right that the behavior is wrong.