From 64bb1f75639136868d762b79daa9cc659bf601d0 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Sun, 7 Nov 2021 17:55:01 +0900 Subject: dap: Extract out variable rendering Will improve on the UI later --- helix-term/src/commands/dap.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'helix-term/src/commands') 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) { -- cgit v1.2.3-70-g09d2