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

[Bug] unexpected behavior when setting MarkEdit to wraps brackets, parentheses, backticks, etc. #825

Open
pa-0 opened this issue Jan 20, 2025 · 3 comments

Comments

@pa-0
Copy link

pa-0 commented Jan 20, 2025

Maybe this is by design, though I don't expect it to be; however, the norm as far as I have observed with all other markdown / markup editors is that the automatic wrapping behavior is contextual in nature.

Explanation:

(Note that wherever "|" appears below represents the location of the caret)

Scenario Automatic Wrap Expected

Opening character inserted at beginning of a new line:

1 foo()
2 [|

YES: closing bracket inserted automatically






Opening character inserted after some text but at the end of a line:

1 foo(|
2

YES: closing parenthesis inserted automatically






Opening character inserted before some non-whitespace characters:

1 `|foo
2

NO: closing backtick is NOT inserted automatically





Note

In all cases, the type of symbol (backtick, parenthesis, bracket) does not affect the behavior. What matters is the position of the caret and whether there exists non-whitespace characters immediately after it.

Conversely, in MarkEdit, I notice that the third scenario above does not hold true. Even when the caret is positioned immediately preceding non-whitespace characters, inserting the backtick (`) still results in a closing backtick being inserted, e.g.

1 ``|foo
2

This tends to interrupt a typical workflow forcing the user to constantly backtrack and delete superfluous / unintended characters. Hopefully, this makes sense, as I feel I could have done a better job articulating the issue.

@cyanzhong
Copy link
Contributor

Thank you for reporting the issue. I just tried and couldn't reproduce it.

1 `|foo
2

This scenario won't add another backtick for me.

Could you please share your app version, keyboard input source, and let me know if brackets and parentheses can reproduce as well?

Thanks.

@cyanzhong
Copy link
Contributor

Also, it would be great if you can provide the content you use to reproduce the issue, thanks!

@cyanzhong
Copy link
Contributor

After further testing, I observed some inconsistent behaviors. Let me know if your findings align with those described in this discussion on the CodeMirror forum.

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