aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-11-22 02:13:22 +0000
committerBlaž Hrastnik2021-11-22 02:14:10 +0000
commit0eadeab8c7c3f1ddc794661782ebbe19ddf5311e (patch)
tree2d91e4cf8cd4bddf951c7ee1140317a37651b7f7 /helix-term/src/commands
parent5f329a22c48ebf586da12323b6e1f45e9d78fdc1 (diff)
dap: Remove the prompt line parameter, use insert_str instead
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/dap.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs
index 113bacd9..e117baff 100644
--- a/helix-term/src/commands/dap.rs
+++ b/helix-term/src/commands/dap.rs
@@ -386,7 +386,6 @@ fn debug_parameter_prompt(
);
}
},
- None,
)
}
@@ -638,9 +637,8 @@ pub fn dap_edit_condition(cx: &mut Context) {
let callback = Box::pin(async move {
let call: Callback =
Box::new(move |_editor: &mut Editor, compositor: &mut Compositor| {
- let condition = breakpoint.condition;
- let prompt = Prompt::new(
- "condition: ".into(),
+ let mut prompt = Prompt::new(
+ "condition:".into(),
None,
|_input: &str| Vec::new(),
move |cx: &mut crate::compositor::Context,
@@ -699,8 +697,10 @@ pub fn dap_edit_condition(cx: &mut Context) {
}
}
},
- condition,
);
+ if let Some(condition) = breakpoint.condition {
+ prompt.insert_str(&condition)
+ }
compositor.push(Box::new(prompt));
});
Ok(call)
@@ -714,9 +714,8 @@ pub fn dap_edit_log(cx: &mut Context) {
let callback = Box::pin(async move {
let call: Callback =
Box::new(move |_editor: &mut Editor, compositor: &mut Compositor| {
- let log_message = breakpoint.log_message;
- let prompt = Prompt::new(
- "log message: ".into(),
+ let mut prompt = Prompt::new(
+ "log-message:".into(),
None,
|_input: &str| Vec::new(),
move |cx: &mut crate::compositor::Context,
@@ -775,8 +774,10 @@ pub fn dap_edit_log(cx: &mut Context) {
}
}
},
- log_message,
);
+ if let Some(log_message) = breakpoint.log_message {
+ prompt.insert_str(&log_message);
+ }
compositor.push(Box::new(prompt));
});
Ok(call)