# cossoledad/feditor architecture

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

- Interactive diagram: https://gitdiagram.com/cossoledad/feditor
- Repository: https://github.com/cossoledad/feditor

## Overview

FEditor is a portable Windows text editor. The main workflow is opening or creating a document in a workspace tab, editing it, and saving it; users can also search, format, print, and recover work. The graph preserves the README’s major capabilities and separates workspace orchestration, document handling, editing features, and persistence. Some source files were not excerpted, so uncertain internal links are dashed rather than presented as verified calls.

Main entry points: [`src/editor.cpp`](https://github.com/cossoledad/feditor/blob/main/src/editor.cpp) (Editor tab), [`src/workspace.cpp`](https://github.com/cossoledad/feditor/blob/main/src/workspace.cpp) (Workspace), [`src/text_io.cpp`](https://github.com/cossoledad/feditor/blob/main/src/text_io.cpp) (Text loading and saving), [`src/document_format.cpp`](https://github.com/cossoledad/feditor/blob/main/src/document_format.cpp) (Document formatting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace and UI"]
  node_workspace_ui["Workspace<br/>[workspace.cpp]"]
  node_editor_tab["Editor tab<br/>[editor.cpp]"]
  node_localization["Localization<br/>[localization.cpp]"]
end

subgraph group_documents["Documents and editing"]
  node_document_file["Document state<br/>[document_file.cpp]"]
  node_text_io["Text loading and saving<br/>[text_io.cpp]"]
  node_binary_view["Binary view<br/>[binary_view.cpp]"]
  node_viewport["Large-file viewport<br/>[text_viewport.cpp]"]
end

subgraph group_features["Editor features"]
  node_language["Language detection"]
  node_syntax["Syntax highlighting<br/>[syntax.cpp]"]
  node_formatting["Document formatting"]
  node_search_pattern["Search patterns<br/>[search_pattern.cpp]"]
  node_regex["Multiline regex"]
  node_search_matches["Match scanning<br/>[search_matches.cpp]"]
  node_match_list["Match list UI<br/>[match_list.cpp]"]
  node_printing["Print layout<br/>[print_document.cpp]"]
  node_system_print["Windows printing<br/>[system_print.cpp]"]
end

subgraph group_state["Preferences and recovery"]
  node_settings["Editor settings"]
  node_session_store[("Session and drafts<br/>[session_store.cpp]")]
end

node_user(("Editor user"))
node_file_system[("Local files")]
node_format_tools["Formatter tools"]

node_user -->|"uses"| node_workspace_ui
node_workspace_ui -->|"manages tabs"| node_editor_tab
node_editor_tab -.->|"tracks document"| node_document_file
node_editor_tab -.->|"loads and saves"| node_text_io
node_text_io -->|"reads and writes"| node_file_system
node_editor_tab -.->|"shows binary data"| node_binary_view
node_editor_tab -.->|"uses for large files"| node_viewport
node_editor_tab -.->|"detects language"| node_language
node_editor_tab -.->|"highlights syntax"| node_syntax
node_editor_tab -.->|"formats document"| node_formatting
node_formatting -.->|"invokes formatters"| node_format_tools
node_editor_tab -.->|"prepares queries"| node_search_pattern
node_editor_tab -.->|"scans regex"| node_regex
node_editor_tab -.->|"indexes matches"| node_search_matches
node_editor_tab -.->|"shows results"| node_match_list
node_editor_tab -.->|"prepares pages"| node_printing
node_printing -.->|"prints pages"| node_system_print
node_workspace_ui -.->|"stores workspace"| node_session_store
node_editor_tab -.->|"applies preferences"| node_settings
node_workspace_ui -.->|"localizes interface"| node_localization

click node_workspace_ui "https://github.com/cossoledad/feditor/blob/main/src/workspace.cpp"
click node_editor_tab "https://github.com/cossoledad/feditor/blob/main/src/editor.cpp"
click node_settings "https://github.com/cossoledad/feditor/blob/main/src/editor_settings.cpp"
click node_localization "https://github.com/cossoledad/feditor/blob/main/src/localization.cpp"
click node_document_file "https://github.com/cossoledad/feditor/blob/main/src/document_file.cpp"
click node_text_io "https://github.com/cossoledad/feditor/blob/main/src/text_io.cpp"
click node_binary_view "https://github.com/cossoledad/feditor/blob/main/src/binary_view.cpp"
click node_viewport "https://github.com/cossoledad/feditor/blob/main/src/text_viewport.cpp"
click node_language "https://github.com/cossoledad/feditor/blob/main/src/language_detection.cpp"
click node_syntax "https://github.com/cossoledad/feditor/blob/main/src/syntax.cpp"
click node_formatting "https://github.com/cossoledad/feditor/blob/main/src/document_format.cpp"
click node_search_pattern "https://github.com/cossoledad/feditor/blob/main/src/search_pattern.cpp"
click node_regex "https://github.com/cossoledad/feditor/blob/main/src/multiline_regex.cpp"
click node_search_matches "https://github.com/cossoledad/feditor/blob/main/src/search_matches.cpp"
click node_match_list "https://github.com/cossoledad/feditor/blob/main/src/match_list.cpp"
click node_printing "https://github.com/cossoledad/feditor/blob/main/src/print_document.cpp"
click node_system_print "https://github.com/cossoledad/feditor/blob/main/src/system_print.cpp"
click node_session_store "https://github.com/cossoledad/feditor/blob/main/src/session_store.cpp"

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_workspace_ui,node_editor_tab,node_localization,node_user toneBlue
class node_document_file,node_text_io,node_binary_view,node_viewport,node_file_system toneAmber
class node_language,node_syntax,node_formatting,node_search_pattern,node_regex,node_search_matches,node_match_list,node_printing,node_system_print toneMint
class node_settings,node_session_store toneRose
class node_format_tools toneIndigo
```

## Components

### Workspace and UI

- [Workspace](https://github.com/cossoledad/feditor/blob/main/src/workspace.cpp): `src/workspace.cpp`
- [Editor tab](https://github.com/cossoledad/feditor/blob/main/src/editor.cpp): `src/editor.cpp`
- [Localization](https://github.com/cossoledad/feditor/blob/main/src/localization.cpp): `src/localization.cpp`

### Documents and editing

- [Document state](https://github.com/cossoledad/feditor/blob/main/src/document_file.cpp): `src/document_file.cpp`
- [Text loading and saving](https://github.com/cossoledad/feditor/blob/main/src/text_io.cpp): `src/text_io.cpp`
- [Binary view](https://github.com/cossoledad/feditor/blob/main/src/binary_view.cpp): `src/binary_view.cpp`
- [Large-file viewport](https://github.com/cossoledad/feditor/blob/main/src/text_viewport.cpp): `src/text_viewport.cpp`

### Editor features

- [Language detection](https://github.com/cossoledad/feditor/blob/main/src/language_detection.cpp): `src/language_detection.cpp`
- [Syntax highlighting](https://github.com/cossoledad/feditor/blob/main/src/syntax.cpp): `src/syntax.cpp`
- [Document formatting](https://github.com/cossoledad/feditor/blob/main/src/document_format.cpp): `src/document_format.cpp`
- [Search patterns](https://github.com/cossoledad/feditor/blob/main/src/search_pattern.cpp): `src/search_pattern.cpp`
- [Multiline regex](https://github.com/cossoledad/feditor/blob/main/src/multiline_regex.cpp): `src/multiline_regex.cpp`
- [Match scanning](https://github.com/cossoledad/feditor/blob/main/src/search_matches.cpp): `src/search_matches.cpp`
- [Match list UI](https://github.com/cossoledad/feditor/blob/main/src/match_list.cpp): `src/match_list.cpp`
- [Print layout](https://github.com/cossoledad/feditor/blob/main/src/print_document.cpp): `src/print_document.cpp`
- [Windows printing](https://github.com/cossoledad/feditor/blob/main/src/system_print.cpp): `src/system_print.cpp`

### Preferences and recovery

- [Editor settings](https://github.com/cossoledad/feditor/blob/main/src/editor_settings.cpp): `src/editor_settings.cpp`
- [Session and drafts](https://github.com/cossoledad/feditor/blob/main/src/session_store.cpp): `src/session_store.cpp`

### Other components

- **Editor user**
- **Local files**
- **Formatter tools**

## Connections

- Editor user → Workspace: uses (evidence: `README.md`)
- Workspace → Editor tab: manages tabs (evidence: `src/workspace.cpp`)
- Editor tab → Document state: tracks document
- Editor tab → Text loading and saving: loads and saves
- Text loading and saving → Local files: reads and writes (evidence: `README.md`)
- Editor tab → Binary view: shows binary data
- Editor tab → Large-file viewport: uses for large files
- Editor tab → Language detection: detects language
- Editor tab → Syntax highlighting: highlights syntax
- Editor tab → Document formatting: formats document
- Document formatting → Formatter tools: invokes formatters (evidence: `README.md`)
- Editor tab → Search patterns: prepares queries
- Editor tab → Multiline regex: scans regex
- Editor tab → Match scanning: indexes matches
- Editor tab → Match list UI: shows results
- Editor tab → Print layout: prepares pages
- Print layout → Windows printing: prints pages
- Workspace → Session and drafts: stores workspace
- Editor tab → Editor settings: applies preferences
- Workspace → Localization: localizes interface
