refactor(main): update headless mode to use App and new command system
Update headless command execution to use the new architecture: - Removed CommandResult import (no longer needed) - Headless mode now creates an App instance and uses cmd_context() - Commands are parsed and executed via the registry, effects applied through app.apply_effects() instead of command::dispatch() - Made cmd_context() public so headless mode can access it - Updated persistence save to use app.model instead of direct model Tests updated to use ExecuteCommand instead of QuitCmd, with proper buffer setup for command parsing. Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
This commit is contained in:
@ -99,7 +99,7 @@ impl App {
|
||||
}
|
||||
}
|
||||
|
||||
fn cmd_context(&self, key: KeyCode, mods: KeyModifiers) -> CmdContext<'_> {
|
||||
pub fn cmd_context(&self, key: KeyCode, mods: KeyModifiers) -> CmdContext<'_> {
|
||||
let view = self.model.active_view();
|
||||
CmdContext {
|
||||
model: &self.model,
|
||||
|
||||
Reference in New Issue
Block a user