aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-11-07 08:55:01 +0000
committerBlaž Hrastnik2021-11-07 08:55:01 +0000
commit64bb1f75639136868d762b79daa9cc659bf601d0 (patch)
tree9fa409f70f71374b7e4ae6528074a2d7abf07542 /helix-term/src/commands
parente2a23ac0b50ad743fa43d0e0cf4492805119e3c8 (diff)
dap: Extract out variable rendering
Will improve on the UI later
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/dap.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs
index 47e1b39f..e7f9c214 100644
--- a/helix-term/src/commands/dap.rs
+++ b/helix-term/src/commands/dap.rs
@@ -3,7 +3,7 @@ use crate::{
commands,
compositor::Compositor,
job::Callback,
- ui::{FilePicker, Picker, Prompt, PromptEvent},
+ ui::{FilePicker, Picker, Popup, Prompt, PromptEvent, Text},
};
use helix_core::{
syntax::{DebugArgumentValue, DebugConfigCompletion},
@@ -518,15 +518,14 @@ pub fn dap_variables(cx: &mut Context) {
Some(data_type) => format!("{} ", data_type),
None => "".to_owned(),
};
- variables.push(format!("{}{} = {}\n", prefix, var.name, var.value));
+ variables.push(format!("{}{} = {}", prefix, var.name, var.value));
}
}
}
- if !variables.is_empty() {
- cx.editor.variables = Some(variables);
- cx.editor.variables_page = 0;
- }
+ let contents = Text::new(variables.join("\n"));
+ let popup = Popup::new(contents);
+ cx.push_layer(Box::new(popup));
}
pub fn dap_terminate(cx: &mut Context) {