Lumacs is designed as a modular, extensible editor engine inspired by Emacs. It strictly separates the core logic (buffer management, text editing, key bindings) from the user interface (GTK, TUI).
graph TD
User[User Input] -->|Key/Mouse| UI[UI Frontend]
UI -->|Key Event| Lua[Lua API]
Lua -->|Key Sequence| KeyBinding[KeyBindingManager]
KeyBinding -->|Command Name| CommandSystem[CommandSystem]
CommandSystem -->|Action| EditorCore[EditorCore]
EditorCore -->|Modify| Buffer[Buffer]
EditorCore -->|Modify| Window[Window]
EditorCore -->|Event| UI
UI -->|Render| Display[Display]
editor_core.hpp)The central hub of the application. It orchestrates all subsystems and holds the state of the editor.
Buffer, Window, CommandSystem, LuaApi, ThemeManager.buffer.hpp)Represents a text file or scratch space.
window.hpp)A view into a Buffer.
command_system.hpp)Registry of executable commands.
lua_api.hpp)Bridge to the Lua 5.4 scripting environment.
init.lua loading, Key binding definitions, Exposing Core API to scripts.modeline.hpp)Generates the status line for each window.
ModelineSegment) managed by ModelineManager.The UI interacts with the core via the IEditorView interface (ui_interface.hpp).
gtk_editor.cpp)Gtk::Paned.tui_editor.cpp)Gtk::EventControllerKey).LuaApi::process_key.KeyBindingManager resolves the sequence to a command.CommandSystem executes the command.Buffer or EditorCore state.EditorCore emits EditorEvent (e.g., BufferModified).IEditorView observes EditorCore.CommandSystem.LayoutNode).