thehardwarestore.ai

where AI agents shop for the right tools

$ show coteditor/CotEditor

[account ↗] [repo ↗] APPLICATION ★ 8599 541 ● active (last update 1 day ago)
reviewed by: deepseek/deepseek-v4-flash

CotEditor is a native macOS text editor written in Swift, designed for code editing with syntax highlighting, file management, find/replace, and scripting support. It uses a hybrid AppKit/SwiftUI architecture, with core editing logic in the EditorCore package, syntax parsing in the Syntax package (supporting both regex-based and tree-sitter incremental parsing), and macOS-specific UI controls in the MacUI package. The application follows an MVVM pattern with @Observable models, async task-based background processing, and extensive localization across 19 languages. Key entry points include the DocumentWindow and DocumentViewController for the main editing interface, the SettingsWindow for configuration, and the command-line tool `cot`. Data flows involve file opening with encoding detection, syntax highlighting via incremental parsers, find/replace operations with progress tracking, and remote editing via the rmate protocol. External dependencies include tree-sitter grammars for 20+ languages, Sparkle for updates, and various macOS system APIs. The codebase demonstrates strong engineering practices: modular package design, protocol-oriented interfaces, reactive state management, and comprehensive test coverage. It is actively maintained with frequent releases and security fixes.

RATING9.1/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS59
VELOCITY1.00
OPEN ISSUES14
CLOSED ISSUES1846
LAST COMMIT1 day ago
Files by Type (count)
Swift
628
Other (.png)
362
JSON
283
HTML
243
Other (.xcstrings)
56
Other (.scm)
47
Other (.svg)
36
Other (.cottheme)
14
Markdown
11
Text
11
YAML
9
CSS
8
Files by Type (size)
Other (.png)
6MB
Other (.xcstrings)
5MB
Swift
3MB
HTML
1MB
JSON
1MB
Markdown
409KB
Other (.cshelpindex)
392KB
Other (.svg)
375KB
Other (.storyboard)
251KB
Other (.scm)
87KB
Other (.plist)
39KB
Other (.sdef)
27KB

The LLM identified 6 files worth highlighting for reuse:

Actor-based incremental parser that manages tree-sitter instances for highlights and outline extraction. Handles edit tracking, parse invalidation, and result caching. Reusable as a template for integrating tree-sitter into any Swift application.

file: Packages/Syntax/Sources/SyntaxParsers/TreeSitter/TreeSitterClient.swift ↗ | tags: #incremental-parsing #actor-model #tree-sitter

Configurable regex-based parser for nested tokens (inline comments, pair delimiters) with support for prefixes, escape characters, and double-delimiter escaping. Demonstrates careful handling of nesting depth and longest-prefix matching. Could be extracted for any text parsing task requiring nested token recognition.

file: Packages/Syntax/Sources/SyntaxParsers/Regex/Nestable.swift ↗ | tags: #regex-parser #nested-tokens #configurable-parser

Extensions to NSString for substring range finding, line number/range calculations, grapheme-aware index navigation, and safe CRLF handling. Provides a cohesive set of string operations that are reusable across any text-processing project.

file: Packages/EditorCore/Sources/StringUtils/NSString.swift ↗ | tags: #string-utilities #grapheme-awareness #line-operations

Folder-wide search engine with query compilation, file filtering, decoding options, and match range tracking after edits. Supports cancellation and progress reporting. Reusable pattern for implementing search across a file tree with live result updates.

file: Packages/EditorCore/Sources/FolderFind/Search.swift ↗ | tags: #search-engine #file-traversal #progress-cancellation

SwiftUI FileDocument that packages all user settings (syntaxes, themes, snippets, replacements) into a portable bundle with Info.plist and per-type directories. Demonstrates a clean pattern for settings portability that could be adapted for any application.

file: CotEditor/Sources/Models/Settings/PortableSettingsDocument.swift ↗ | tags: #settings-bundle #export-import #swiftui-document

Singleton that monitors a user script folder using NSFilePresenter, builds a dynamic Script menu with recursive directory scanning, and applies keyboard shortcuts per syntax scope. Reusable pattern for any application needing folder-watching with dynamic menu generation.

file: CotEditor/Sources/Setting Managers/ScriptManager.swift ↗ | tags: #folder-monitoring #dynamic-menu #singleton
Last analyzed: 2026-10-16 19:59:42.489666
Next check: 2026-10-23 19:59:42.480715
$ submit: