Neon Vision is a native SwiftUI application targeting macOS 14.0+ (Sonoma/Tahoe). Unlike Electron editors, we rely on Apple's TextKit 2 and SwiftUI for rendering to ensure zero-latency typing.
- Backing Store: We do not load entire files into memory strings. We use a
Ropedata structure (ormmapfor large files >10MB) to handle inserts/deletes efficiently. - Syntax Highlighting: Powered by
TreeSitter.- Performance Note: Highlighting runs on a background
DispatchQueue. The main thread only receives the finalNSAttributedStringfor the visible viewport.
- Performance Note: Highlighting runs on a background
- Security Scoped Bookmarks: To support the "Open Recent" menu in a sandboxed environment (required for App Store), we persist security-scoped bookmarks, not just file paths.
- Coordinator: All file writes go through
NSFileCoordinatorto prevent data races with external edits.
- Multi-Window: Neon uses
WindowGroupwithidinjection to support multiple independent editor instances. State is not shared between windows unless explicitly passed viaAppDependencyContainer.
- Large Files: Editing files >100MB is currently experimental. Logic for "chunking" lines lives in
LineManager.swift. - Vim Mode: State machine located in
VimInputController.swift. All key events are intercepted before they reach the standardNSTextInputClient.