aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
authorDmitry Sharshakov2021-08-22 12:06:27 +0000
committerDmitry Sharshakov2021-08-22 12:06:27 +0000
commitf247858055ee17e6d4a61d7284548febe1d7f54d (patch)
tree3ca60cdd16b1cd9c2c147c912321fbdaf03a3984 /helix-term/src/ui
parent3197c2536ecb0f4f7aa4dfb75ece549b72249541 (diff)
Support conditional breakpoints
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/editor.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index f8035ae4..8a6f63f9 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -472,8 +472,13 @@ impl EditorView {
let selected = cursors.contains(&line);
if let Some(bps) = breakpoints.as_ref() {
- if bps.iter().any(|breakpoint| breakpoint.line - 1 == line) {
- surface.set_stringn(viewport.x, viewport.y + i as u16, "▲", 1, warning);
+ if let Some(breakpoint) = bps.iter().find(|breakpoint| breakpoint.line - 1 == line)
+ {
+ if breakpoint.condition.is_some() {
+ surface.set_stringn(viewport.x, viewport.y + i as u16, "▲", 1, error);
+ } else {
+ surface.set_stringn(viewport.x, viewport.y + i as u16, "▲", 1, warning);
+ }
}
}