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

CodeMirror 6 quirk list #10439

Open
laurent22 opened this issue May 17, 2024 · 2 comments · Fixed by #10441
Open

CodeMirror 6 quirk list #10439

laurent22 opened this issue May 17, 2024 · 2 comments · Fixed by #10441
Labels
bug It's a bug editor high High priority issues

Comments

@laurent22
Copy link
Owner

laurent22 commented May 17, 2024

We would like the CodeMirror 6 editor to work like a regular text editor, with as few surprising or "smart" behaviours as possible. A good reference would be VSCode with default settings.

Indenting a list item moves the cursor to the end of the line

Fixed in: #10441

  • Create this list:
- one
- two

Ident the second item by moving the cursor before - two and press tab.

- one
    - two

Bug: The cursor moves to the end of the item like so - two|

Expected: The cursor should stay where it was, which would be before the dash: |-two

Editor wrongly guesses the number of newlines

  • Create a list with these items:
- one

- two
  • Move the cursor at the end of the first line: - one|
  • Press Enter
  • Bug: The editor inserts two newlines instead of one:
- one

-

- two
  • Expected: Pressing Enter once should enter one newline, never two or three.
@laurent22 laurent22 added bug It's a bug editor high High priority issues labels May 17, 2024
@personalizedrefrigerator
Copy link
Collaborator

personalizedrefrigerator commented May 17, 2024

Based on this commit ("preserve list tightness"), this seems to be an intentional upstream change. This doesn't happen in Joplin 2.14.20, so is a regression.

Here are a few options:

  • Downgrade @codemirror/lang-markdown to version 6.2.3.
  • Patch @codemirror/lang-markdown
  • Create a forum post upstream, asking them to revert the change, or make this an option.
  • Implement our own list continuation logic.

Edit: The behavior before v6.2.3 might also have some issues. See this forum post for details. The forum post author resolved the issue by writing their own list continuation logic.

@personalizedrefrigerator
Copy link
Collaborator

Bug: The cursor moves to the end of the item like so - two|

Expected: The cursor should stay where it was, which would be before the dash: |-two

This should be resolved by #10441.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug editor high High priority issues
Projects
None yet
2 participants