Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- A space typed at the right edge of a wrapped line shows where the next character will go: the caret is drawn at the start of the next line, or of the new line below a paragraph's last line, and ↑ ↓ ⌘← ⌘→ start from there. TextKit clamped it to the margin, where the clipped text view cut it off, so the space looked like it did nothing.
- Switching to a document with the same text as the open one (two empty notes) completes. The editor kept the old `documentId` for the rest of its life: a scrolling header snapped instead of animating on every height change, and undo filed the new document's edits under the old one.
- VoiceOver no longer scrolls the text about 75 pt each time its cursor lands on it. The text view now reports only its visible part as its accessibility frame; an element taller than the viewport was scrolled until its top sat near the scroll area's top, past the header band.

## [0.15.0] - 2026-10-22

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// NativeTextView+Accessibility.swift
// MarkdownEngine
//
// Created by Luca Chen on 26.10.26.
//

import AppKit

extension NativeTextView {
/// Only the part inside the viewport. VoiceOver scrolls an element taller than the
/// viewport until its top sits ~35 pt under the scroll area's top, and the text
/// starts below the header band, so the page moved ~75 pt whenever the VoiceOver
/// cursor landed on it (measured on 27.0.1). Lines report their own bounds.
override func accessibilityFrame() -> NSRect {
let full = super.accessibilityFrame()
guard let scrollView = enclosingScrollView, let window else { return full }
let clip = scrollView.contentView
var viewport = window.convertToScreen(clip.convert(clip.bounds, to: nil))
let insets = scrollView.contentInsets
viewport.origin.y += insets.bottom
viewport.size.height -= insets.top + insets.bottom
let visible = full.intersection(viewport)
return visible.isNull ? full : visible
}
}
Loading