Correctly display 1-based breakpoints

This commit is contained in:
Dmitry Sharshakov 2021-08-21 15:17:25 +03:00
parent 7087558918
commit 3fc501c99f
No known key found for this signature in database
GPG key ID: 471FD32E15FD8473

View file

@ -475,7 +475,7 @@ impl EditorView {
let selected = cursors.contains(&line); let selected = cursors.contains(&line);
if let Some(bps) = breakpoints.as_ref() { if let Some(bps) = breakpoints.as_ref() {
if bps.iter().any(|breakpoint| breakpoint.line == line) { if bps.iter().any(|breakpoint| breakpoint.line - 1 == line) {
surface.set_stringn(viewport.x, viewport.y + i as u16, "", 1, warning); surface.set_stringn(viewport.x, viewport.y + i as u16, "", 1, warning);
} }
} }
@ -486,7 +486,7 @@ impl EditorView {
.path() .path()
.map(|path| src.path == Some(path.clone())) .map(|path| src.path == Some(path.clone()))
.unwrap_or(false) .unwrap_or(false)
&& sp.line == line && sp.line - 1 == line
{ {
surface.set_style( surface.set_style(
Rect::new(viewport.x, viewport.y + i as u16, 6, 1), Rect::new(viewport.x, viewport.y + i as u16, 6, 1),