posit-dev / positron

Positron, a next-generation data science IDE
Other
2.48k stars 77 forks source link

Cursor location after typing [ in markdown #3721

Open jonthegeek opened 3 months ago

jonthegeek commented 3 months ago

Positron Version:

Positron Version: 2024.06.1 (system setup) build 2024.06.1-27 Code - OSS Version: 1.90.0 Commit: a893e5b282612ccb2200102957ac38d3c14e5196 Date: 2024-06-26T01:33:58.809Z Electron: 29.4.0 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.22631

Steps to reproduce the issue:

  1. Open a (markdown) document
  2. Type thing
  3. Select the text "thing".
  4. Type [
  5. Note cursor location
  6. Type ]
  7. Note mess

vs

  1. Open a markdown document
  2. Type [
  3. Type thing
  4. Type ]
  5. Note cursor location

What did you expect to happen?

  1. When I select text and type [, the text should be wrapped in [] (correctly occurs), and the cursor should be placed to the right of the ] (so I can then type ( and provide a url).
  2. When I encounter a ] and type ], my cursor should move to the right of the ] without adding a new ].

Were there any error messages in the output or Developer Tools console?

No.

Perhaps this requires an extension beyond the Quarto extension? It doesn't feel like it should.

petetronic commented 3 months ago

Thanks for logging this issue, I was able to reproduce the issue in a Python cell of a Quarto markdown document.

Note that it also seems to happen in VS Code and in other languages. In RStudio, the first case collapses to [].