Root cause: ns_ax_buffer_text used BUF_BYTE_ADDRESS + raw pointer read which crosses the buffer gap when visible runs span it. The gap follows point, so completion cycling and dired navigation reliably trigger corruption — VoiceOver reads wrong text. Fix: Replace raw pointer extraction with Fbuffer_substring_no_properties which handles the gap internally. Add ax_length field to visible run struct for accurate UTF-16 length tracking (fixes supplementary Unicode character offset drift). Secondary: ax_offset accumulation now uses NSString length (UTF-16 units) instead of Emacs char count, preventing progressive drift in index mapping for subsequent visible runs.
45 KiB
45 KiB