HighlightedTextEditor
HighlightedTextEditor copied to clipboard
[Markdown] Entering text will jitter after pressing enter in the title
DO NOT DELETE THIS TEMPLATE
If you do not fill out this template, your issue will be automatically closed.
Describe the bug In markdown mode, text input will jitter after pressing enter in the title.
To Reproduce
- Input "# aaaaaa"
- Press "Enter" and input "aaaaa"
- After returning the cursor to "# aaaaaa", press enter, and then enter text
Expected behavior Normally output text in default font
Screenshots If applicable, add screenshots to help explain your problem.
https://github.com/kyle-n/HighlightedTextEditor/assets/7531576/52015b48-5278-4586-9a6b-d052ca3c1652
Environment Please include:
- macOS 12.7.2
- AppKit, SwiftUI
Additional context Add any other context about the problem here.
It is worth mentioning that I also have a similar font size bug when using another markdown editor (SwiftDown). I don’t know if it is because of the system version. I am preparing to upgrade to the latest macos system. After that, I will give feedback.
The bug still exists in macOS 14.2.1
Confirmed the bug is happening on macOS 14.2.1.
Code to reproduce:
struct MarkdownEditorA: View {
@State var text: String = ""
var body: some View {
HighlightedTextEditor(text: $text, highlightRules: .markdown)
}
}
Steps:
- Type "a" (without quotes) and press return twice
- Type "# b" and press return twice
- Type "c"
- Use the mouse to move the insertion point to the end of "# b"
- Press return once and type "d"
- Observe each letter typed starts as big, then resizes to regular size
Not sure what the problem is. Going to see if anyone else is having trouble with NSTextView()
on Sonoma.
I am experiencing the same issue on macOS 14.2.1 Sonoma.
Reproducible on macOS 14.3.1 as well.