class

Adamantine::App

Inherits Adamantine::BoxDrawing < Adamantine::LspController < Adamantine::NavigationController < Adamantine::ModalManager < Adamantine::InputRouter < Adamantine::KeyboardModeEngine < Adamantine::SearchPanel < Adamantine::OverlayController < Adamantine::InputModeController < Adamantine::CommandPalette < Tui::App < Tui::Widget < Tui::Reactive < Reference < Object

Constants

BODY_LOG_RATIO = 0.84
COMMAND_ENTRIES = [CommandEntry.new(["w", "write"], "Save active file"), CommandEntry.new(["q", "close"], "Close active tab"), CommandEntry.new(["quit", "exit", "qa", "q!"], "Quit editor"), CommandEntry.new(["wq", "wx", "writequit"], "Save and quit"), CommandEntry.new(["e", "open", "edit"], "Open file path"), CommandEntry.new(["theme"], "Apply theme preset by name"), CommandEntry.new(["themes"], "List available themes"), CommandEntry.new(["lsp"], "Show LSP connection status"), CommandEntry.new(["tabnext", "next"], "Activate next tab"), CommandEntry.new(["tabprev", "prev"], "Activate previous tab"), CommandEntry.new(["help", "?"], "Show command list"), CommandEntry.new(["tree"], "Focus project tree"), CommandEntry.new(["focus-tree", "tree-focus"], "Focus project tree"), CommandEntry.new(["focus-editor", "edit-focus"], "Focus active editor"), CommandEntry.new(["open-theme"], "Reload active theme file"), CommandEntry.new(["ls", "buffers"], "List open buffers"), CommandEntry.new(["jumpback", "pop"], "Jump back in navigation history"), CommandEntry.new(["jumpforward", "jf"], "Jump forward in navigation history"), CommandEntry.new(["undo"], "Undo last edit in the active editor"), CommandEntry.new(["redo"], "Redo last undone edit in the active editor"), CommandEntry.new(["settings"], "Open settings dialog"), CommandEntry.new(["bnext", "bn"], "Go to next tab"), CommandEntry.new(["bprev", "bp"], "Go to previous tab"), CommandEntry.new(["buf", "buffer"], "Select buffer by index, index starts at 1"), CommandEntry.new(["search", "find"], "Open find panel for the current file (also /pattern)"), CommandEntry.new(["grep", "rg"], "Open project search panel"), CommandEntry.new(["set"], "Show or set editor options"), CommandEntry.new(["cd"], "Change project root and file tree path"), CommandEntry.new(["pwd", "cwd"], "Show current working directory"), CommandEntry.new(["mark"], "Set local mark"), CommandEntry.new(["marks"], "List marks"), CommandEntry.new(["jump"], "Jump to mark"), CommandEntry.new(["replace", "s", "r"], "Replace text: :r /old/new/ [gic] or :s/old/new/[gic]")]
EDITOR_TITLE = (ENV["ADAMANTINE_TITLE"]? || ENV["EDITOR_TITLE"]?) || "Adamantine"
FILE_PANEL_RATIO = 0.22
MIN_EDITOR_WIDTH = 24
MIN_FILE_PANEL_WIDTH = 18
MIN_LOG_HEIGHT = 6
STATUS_LOG_MAX_ENTRIES = 200

Constructors

new(project_root : Path, lsp_command : String | Nil = nil, lsp_args : Array(String) = [] of String, keymap_path : String | Nil = nil, theme_path : String | Nil = nil)
Source

Instance methods

compose

Override to create root widget tree

Source
on_capture(event : Tui::Event) : Bool

Capture app-level keys before they reach children

Source
on_event(event : Tui::Event) : Bool

Handle 'q' for quit only if children didn't handle it

Source
quit(force : Bool = false) : Nil

Stop the application

Source

Nested types