feat(command): add CmdContext extensions and new effects
Add new fields to CmdContext for tracking search mode, panel cursors, tile category index, named text buffers, and key information. Add SetBuffer and SetTileCatIdx effects for managing application state. Update TileBar to accept tile_cat_idx parameter for rendering. Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
This commit is contained in:
@ -281,6 +281,26 @@ impl Effect for SetSearchMode {
|
||||
}
|
||||
}
|
||||
|
||||
/// Set a named buffer's contents.
|
||||
#[derive(Debug)]
|
||||
pub struct SetBuffer {
|
||||
pub name: String,
|
||||
pub value: String,
|
||||
}
|
||||
impl Effect for SetBuffer {
|
||||
fn apply(&self, app: &mut App) {
|
||||
app.buffers.insert(self.name.clone(), self.value.clone());
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct SetTileCatIdx(pub usize);
|
||||
impl Effect for SetTileCatIdx {
|
||||
fn apply(&self, app: &mut App) {
|
||||
app.tile_cat_idx = self.0;
|
||||
}
|
||||
}
|
||||
|
||||
// ── Side effects ─────────────────────────────────────────────────────────────
|
||||
|
||||
#[derive(Debug)]
|
||||
|
||||
Reference in New Issue
Block a user