diff --git a/helix-view/src/editor/config.rs b/helix-view/src/editor/config.rs index 00100ff5..5c7f5345 100644 --- a/helix-view/src/editor/config.rs +++ b/helix-view/src/editor/config.rs @@ -2,14 +2,13 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; -// TODO: Dap: verified ●, unverified ◯ - #[derive(Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone)] pub struct Icons { pub mime: Mime, pub lsp: Lsp, pub diagnostic: Diagnostic, pub vcs: Vcs, + pub dap: Dap, } // https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentSymbol @@ -248,3 +247,26 @@ impl Mime { self.mime.get(mime).map_or("*", |mime| mime) } } + +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Default)] +pub struct Dap { + verified: Option, + unverified: Option, +} + +impl Dap { + const DEFAULT_VERIFIED: &'static str = "●"; + const DEFAULT_UNVERIFIED: &'static str = "◯"; + + pub fn verified(&self) -> &str { + self.verified + .as_ref() + .map_or(Self::DEFAULT_VERIFIED, |verified| verified) + } + + pub fn unverified(&self) -> &str { + self.verified + .as_ref() + .map_or(Self::DEFAULT_UNVERIFIED, |verified| verified) + } +} diff --git a/helix-view/src/gutter.rs b/helix-view/src/gutter.rs index 7a73140a..d1593180 100644 --- a/helix-view/src/gutter.rs +++ b/helix-view/src/gutter.rs @@ -274,7 +274,13 @@ pub fn breakpoints<'doc>( breakpoint_style }; - let sym = if breakpoint.verified { "●" } else { "◯" }; + let config = editor.config(); + + let sym = if breakpoint.verified { + config.icons.dap.verified() + } else { + config.icons.dap.unverified() + }; write!(out, "{}", sym).unwrap(); Some(style) },