fix: use downstream caret affinity after heading edits

This commit is contained in:
Valdemar Lorenzen
2026-10-21 16:32:24 +02:00
parent 489fa84b3c
commit 5065ba59bd
4 changed files with 30 additions and 2 deletions
+3 -1
View File
@@ -335,7 +335,9 @@ final class NotesTextView: NSTextView, @MainActor NSLayoutManagerDelegate {
if structural { breakUndoCoalescing() }
}
let caret = renderedRange(for: NSRange(location: caretPosition, length: 0))
setSelectedRange(NSRange(location: hiddenBoundary(from: caret.location, forward: true), length: 0))
// Upstream affinity places the caret above a paragraph's hidden leading glyphs.
setSelectedRange(NSRange(location: hiddenBoundary(from: caret.location, forward: true), length: 0),
affinity: .downstream, stillSelecting: false)
}
override func deleteBackward(_ sender: Any?) {