Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Oleksiy Syvokon
585110b2cb Register agent actions 2025-07-22 17:46:54 +03:00
Oleksiy Syvokon
4059a21422 vim: Use d p and d u for rejecting/keeping agent edits 2025-07-22 13:35:22 +03:00
5 changed files with 16 additions and 2 deletions

1
Cargo.lock generated
View file

@ -17688,6 +17688,7 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
name = "vim"
version = "0.1.0"
dependencies = [
"agent_ui",
"anyhow",
"assets",
"async-compat",

View file

@ -579,6 +579,13 @@
"shift-u": "git::UnstageAndNext" // "d shift-u"
}
},
{
"context": "VimControl && (AgentDiff || editor_agent_diff)",
"bindings": {
"d p": "agent::Reject",
"d u": "agent::Keep"
}
},
{
"context": "vim_operator == gu",
"bindings": {

View file

@ -197,6 +197,11 @@ impl ModelUsageContext {
}
}
pub fn init_settings(cx: &mut App) {
AgentSettings::register(cx);
SlashCommandSettings::register(cx);
}
/// Initializes the `agent` crate.
pub fn init(
fs: Arc<dyn Fs>,
@ -206,8 +211,7 @@ pub fn init(
is_eval: bool,
cx: &mut App,
) {
AgentSettings::register(cx);
SlashCommandSettings::register(cx);
init_settings(cx);
assistant_context::init(client.clone(), cx);
rules_library::init(cx);

View file

@ -52,6 +52,7 @@ zed_actions.workspace = true
workspace-hack.workspace = true
[dev-dependencies]
agent_ui.workspace = true
assets.workspace = true
command_palette.workspace = true
editor = { workspace = true, features = ["test-support"] }

View file

@ -29,6 +29,7 @@ impl VimTestContext {
editor::init_settings(cx);
project::Project::init_settings(cx);
theme::init(theme::LoadThemes::JustBase, cx);
agent_ui::init_settings(cx);
});
}