From af08436f98d8fd001b4bd1cf19e323ac9aa68ddf Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 10 Nov 2026 23:49:44 +0000 Subject: [PATCH] address review: keep zero-character leading rows in row_span_at --- crates/ui-egui/src/panels/notes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/notes.rs b/crates/ui-egui/src/panels/notes.rs index 9dd516197..f61479f62 100644 --- a/crates/ui-egui/src/panels/notes.rs +++ b/crates/ui-egui/src/panels/notes.rs @@ -213,7 +213,7 @@ pub fn editor( /// The (min y, max y) of the row holding char index `at`; `walk` (row index, chars through that /// row) carries over between calls, so successive non-decreasing `at`s cost one pass in all. fn row_span_at(galley: &Galley, walk: &mut (usize, usize), at: usize) -> (f32, f32) { - while walk.1 <= at && walk.0 + 1 < galley.rows.len() { + while walk.0 + 1 < galley.rows.len() && (walk.1 < at || (walk.1 == at && galley.rows[walk.0].char_count_including_newline().0 > 0)) { walk.0 += 1; walk.1 += galley.rows[walk.0].char_count_including_newline().0; }