Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wonky cursor positions? #90

Open
eneroth opened this issue Sep 25, 2020 · 1 comment
Open

Wonky cursor positions? #90

eneroth opened this issue Sep 25, 2020 · 1 comment

Comments

@eneroth
Copy link

eneroth commented Sep 25, 2020

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)

@eraserhd
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants