parinfer-rust icon indicating copy to clipboard operation
parinfer-rust copied to clipboard

Wonky cursor positions?

Open eneroth opened this issue 5 years ago • 1 comments

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)

eneroth avatar Sep 25 '20 15:09 eneroth

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.

eraserhd avatar Sep 28 '20 13:09 eraserhd