From bf1e00c0135c38544e5e745a9559ca8eed76454e Mon Sep 17 00:00:00 2001 From: GNUSheep Date: Fri, 20 Sep 2024 19:57:52 +0200 Subject: [PATCH] Fix bug: bad rendering doc syntax diagnostic --- helix-term/src/ui/picker.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 374d3f018..b5cba13bd 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -970,8 +970,11 @@ impl Picker { &cx.editor.theme, ); - let mut overlay_highlights = - EditorView::empty_highlight_iter(doc, offset.anchor, area.height); + let mut overlay_highlights = EditorView::empty_highlight_iter( + doc, + doc.text().slice(..).line_to_char(offset.vertical_offset), + area.height, + ); for spans in EditorView::doc_diagnostics_highlights(doc, &cx.editor.theme) { if spans.is_empty() { continue;