How hinchley/texteditor works
This is a small, non-modal terminal text editor. The main workflow is: launch with paths, load them into a workspace of documents and views, read terminal input, dispatch commands or insert text, then render the updated views. Editing, file/workspace management, search, clipboard, syntax highlighting, and configurable keys and themes are distinct capabilities. Edges follow the sampled source index and excerpts or README; unsampled module internals and some feature-to-module links are therefore left unasserted.
Main entry points: app.c Application loop · editor.c Editing views · command.c Command registry · screen.c Screen rendering
Components 26
Runtime and input
- Startup
src/main.c - Application loop
src/app.c - Key input
src/input.c - Key decoding
src/key.c - Terminal control
src/terminal.c - Key bindings
src/keymap.c - Configuration
src/config.c
Documents and editing
- Document state
src/document.c - Text buffer
src/buffer.c - Editing views
src/editor.c - Undo history
src/undo.c - System clipboard
src/clipboard.c
Commands and workspace
- Command registry
src/command.c - Workspace and buffers
src/workspace.c - Buffer picker
src/picker.c - Shortcut help
src/help.c - Interactive prompts
src/prompt.c - Search and replace
src/search.c
Display and syntax
- Screen rendering
src/screen.c - Text layout
src/render.c - Syntax highlighting
src/highlight.c - Language detection
src/lang.c - Theme colors
src/theme.c - UTF-8 support
src/unicode.c
Other components
- Editor user
- Terminal
Connections 39
- Editor user → Startup: opens files
- Startup → Application loop: starts
src/main.c - Application loop → Configuration: loads
src/app.c - Application loop → Key bindings: initializes
src/app.c - Application loop → Workspace and buffers: opens paths
src/app.c - Application loop → Key input: reads keys
src/app.c - Key input → Terminal control: reads bytes
src/input.c - Key input → Key decoding: decodes
src/input.c - Application loop → Key bindings: looks up keys
src/app.c - Application loop → Command registry: dispatches
src/app.c - Application loop → Screen rendering: renders workspace
src/app.c - Application loop → Terminal control: controls session
src/app.c - Key bindings → Key decoding: binds keys
- Key bindings → Command registry: maps commands
- Configuration → Key bindings: configures
- Command registry → Workspace and buffers: manages buffers
- Command registry → Buffer picker: invokes
src/command.c - Command registry → Shortcut help: invokes
src/command.c - Command registry → Interactive prompts: uses prompts
src/command.c - Command registry → Search and replace: invokes
src/command.c - Workspace and buffers → Editing views: creates views
- Document state → Text buffer: holds text
- Document state → Undo history: tracks history
- Document state → Language detection: records language
- Editing views → Document state: edits document
- Editing views → System clipboard: copies and pastes
src/editor.c - Editing views → Text layout: uses layout
src/editor.c - Editing views → UTF-8 support: handles codepoints
src/editor.c - Editing views → Undo history: undoes edits
- Search and replace → Editing views: updates matches
- Screen rendering → Text layout: draws text
src/screen.c - Screen rendering → Syntax highlighting: requests colors
src/screen.c - Screen rendering → Terminal control: writes frames
src/screen.c - Screen rendering → Theme colors: gets palette
src/screen.c - Syntax highlighting → Theme colors: maps captures
src/highlight.c - Syntax highlighting → Language detection: uses grammar
- Text layout → UTF-8 support: measures glyphs
src/render.c - Terminal → Key input: provides keystrokes
src/input.c - Terminal control → Terminal: draws interface