# robertobissanti/tinyedit architecture

> Architecture diagram of the GitHub repository robertobissanti/tinyedit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/robertobissanti/tinyedit
- Repository: https://github.com/robertobissanti/tinyedit

## Overview

tinyedit is a single-document, full-screen POSIX terminal editor. The user opens or creates a file, edits text with familiar keyboard and optional mouse interactions, and saves changes; unsaved work can be recovered from automatic backups. The graph preserves the README’s major editing, search, highlighting, display, settings, clipboard, and terminal capabilities. Source evidence is limited to the supplied excerpts and SOURCE INDEX; unverified internal links are omitted rather than inferred.

Main entry points: [`src/tinyedit.c`](https://github.com/robertobissanti/tinyedit/blob/master/src/tinyedit.c) (Editor runtime), [`src/buffer.c`](https://github.com/robertobissanti/tinyedit/blob/master/src/buffer.c) (Text buffer), [`src/clipboard.c`](https://github.com/robertobissanti/tinyedit/blob/master/src/clipboard.c) (Clipboard), [`src/syntax.c`](https://github.com/robertobissanti/tinyedit/blob/master/src/syntax.c) (Syntax highlighting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Editor runtime"]
  node_editor["Editor runtime<br/>[tinyedit.c]"]
  node_allocator["Allocation helpers<br/>[alloc.c]"]
end

subgraph group_document["Document editing"]
  node_buffer["Text buffer<br/>[buffer.c]"]
  node_history["Undo history<br/>[history.c]"]
  node_utf8["UTF-8 handling<br/>[utf8.c]"]
end

subgraph group_features["Editing features"]
  node_search["Search and replace<br/>[search.c]"]
  node_clipboard["Clipboard<br/>[clipboard.c]"]
  node_syntax["Syntax highlighting<br/>[syntax.c]"]
  node_syntax_configs["User syntax definitions"]
  node_settings["Settings<br/>[settings.c]"]
end

subgraph group_interface["Terminal interface"]
  node_terminal["Terminal input<br/>[terminal.c]"]
  node_menu["Menus and commands<br/>[menu.c]"]
  node_render["Screen rendering<br/>[render.c]"]
end

subgraph group_persistence["Persistence"]
  node_fileio["File I/O<br/>[fileio.c]"]
  node_backup["Backup recovery<br/>[backup.c]"]
end

node_user(("Editor user"))
node_clipboard_service["System clipboard"]
node_filesystem["Local files"]

node_user -->|"edits files"| node_editor
node_editor -->|"reads input"| node_terminal
node_user -->|"finds and replaces"| node_search
node_user -->|"copies and pastes"| node_clipboard
node_clipboard -->|"uses native tools"| node_clipboard_service
node_user -->|"changes preferences"| node_settings
node_user -->|"navigates menus"| node_menu
node_editor -->|"opens and saves"| node_filesystem
node_editor -->|"recovers unsaved work"| node_backup
node_editor -.->|"edits document"| node_buffer
node_editor -.->|"records undo history"| node_history
node_editor -.->|"loads and saves"| node_fileio
node_editor -.->|"runs searches"| node_search
node_editor -.->|"highlights text"| node_syntax
node_editor -.->|"loads preferences"| node_settings
node_editor -.->|"dispatches commands"| node_menu
node_editor -.->|"draws interface"| node_render
node_buffer -.->|"measures text"| node_utf8
node_render -.->|"measures display width"| node_utf8
node_syntax -->|"supports definitions"| node_syntax_configs
node_fileio -.->|"reads and replaces"| node_filesystem
node_backup -.->|"stores recovery data"| node_filesystem
node_allocator -.->|"allocates storage"| node_buffer

click node_editor "https://github.com/robertobissanti/tinyedit/blob/master/src/tinyedit.c"
click node_terminal "https://github.com/robertobissanti/tinyedit/blob/master/src/terminal.c"
click node_buffer "https://github.com/robertobissanti/tinyedit/blob/master/src/buffer.c"
click node_history "https://github.com/robertobissanti/tinyedit/blob/master/src/history.c"
click node_fileio "https://github.com/robertobissanti/tinyedit/blob/master/src/fileio.c"
click node_backup "https://github.com/robertobissanti/tinyedit/blob/master/src/backup.c"
click node_search "https://github.com/robertobissanti/tinyedit/blob/master/src/search.c"
click node_clipboard "https://github.com/robertobissanti/tinyedit/blob/master/src/clipboard.c"
click node_syntax "https://github.com/robertobissanti/tinyedit/blob/master/src/syntax.c"
click node_syntax_configs "https://github.com/robertobissanti/tinyedit/tree/master/syntax-configs"
click node_settings "https://github.com/robertobissanti/tinyedit/blob/master/src/settings.c"
click node_menu "https://github.com/robertobissanti/tinyedit/blob/master/src/menu.c"
click node_render "https://github.com/robertobissanti/tinyedit/blob/master/src/render.c"
click node_utf8 "https://github.com/robertobissanti/tinyedit/blob/master/src/utf8.c"
click node_allocator "https://github.com/robertobissanti/tinyedit/blob/master/src/alloc.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_editor,node_allocator,node_user toneBlue
class node_buffer,node_history,node_utf8 toneAmber
class node_search,node_clipboard,node_syntax,node_syntax_configs,node_settings toneMint
class node_terminal,node_menu,node_render toneRose
class node_fileio,node_backup,node_clipboard_service,node_filesystem toneIndigo
```

## Components

### Editor runtime

- [Editor runtime](https://github.com/robertobissanti/tinyedit/blob/master/src/tinyedit.c): `src/tinyedit.c`
- [Allocation helpers](https://github.com/robertobissanti/tinyedit/blob/master/src/alloc.c): `src/alloc.c`

### Document editing

- [Text buffer](https://github.com/robertobissanti/tinyedit/blob/master/src/buffer.c): `src/buffer.c`
- [Undo history](https://github.com/robertobissanti/tinyedit/blob/master/src/history.c): `src/history.c`
- [UTF-8 handling](https://github.com/robertobissanti/tinyedit/blob/master/src/utf8.c): `src/utf8.c`

### Editing features

- [Search and replace](https://github.com/robertobissanti/tinyedit/blob/master/src/search.c): `src/search.c`
- [Clipboard](https://github.com/robertobissanti/tinyedit/blob/master/src/clipboard.c): `src/clipboard.c`
- [Syntax highlighting](https://github.com/robertobissanti/tinyedit/blob/master/src/syntax.c): `src/syntax.c`
- [User syntax definitions](https://github.com/robertobissanti/tinyedit/tree/master/syntax-configs): `syntax-configs`
- [Settings](https://github.com/robertobissanti/tinyedit/blob/master/src/settings.c): `src/settings.c`

### Terminal interface

- [Terminal input](https://github.com/robertobissanti/tinyedit/blob/master/src/terminal.c): `src/terminal.c`
- [Menus and commands](https://github.com/robertobissanti/tinyedit/blob/master/src/menu.c): `src/menu.c`
- [Screen rendering](https://github.com/robertobissanti/tinyedit/blob/master/src/render.c): `src/render.c`

### Persistence

- [File I/O](https://github.com/robertobissanti/tinyedit/blob/master/src/fileio.c): `src/fileio.c`
- [Backup recovery](https://github.com/robertobissanti/tinyedit/blob/master/src/backup.c): `src/backup.c`

### Other components

- **Editor user**
- **System clipboard**
- **Local files**

## Connections

- Editor user → Editor runtime: edits files (evidence: `README.md`)
- Editor runtime → Terminal input: reads input (evidence: `src/tinyedit.c`)
- Editor user → Search and replace: finds and replaces (evidence: `README.md`)
- Editor user → Clipboard: copies and pastes (evidence: `README.md`)
- Clipboard → System clipboard: uses native tools (evidence: `README.md`)
- Editor user → Settings: changes preferences (evidence: `README.md`)
- Editor user → Menus and commands: navigates menus (evidence: `README.md`)
- Editor runtime → Local files: opens and saves (evidence: `README.md`)
- Editor runtime → Backup recovery: recovers unsaved work (evidence: `README.md`)
- Editor runtime → Text buffer: edits document
- Editor runtime → Undo history: records undo history
- Editor runtime → File I/O: loads and saves
- Editor runtime → Search and replace: runs searches
- Editor runtime → Syntax highlighting: highlights text
- Editor runtime → Settings: loads preferences
- Editor runtime → Menus and commands: dispatches commands
- Editor runtime → Screen rendering: draws interface
- Text buffer → UTF-8 handling: measures text
- Screen rendering → UTF-8 handling: measures display width
- Syntax highlighting → User syntax definitions: supports definitions (evidence: `README.md`)
- File I/O → Local files: reads and replaces
- Backup recovery → Local files: stores recovery data
- Allocation helpers → Text buffer: allocates storage
