From 497ff72128d2dc6c08a19c9ee88943e911c8892e Mon Sep 17 00:00:00 2001 From: SoraTenshi Date: Thu, 21 Mar 2024 18:36:00 +0100 Subject: [PATCH] Fix panic on cache validation step --- helix-term/src/ui/context.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/ui/context.rs b/helix-term/src/ui/context.rs index 4226522ae..e7a6f3516 100644 --- a/helix-term/src/ui/context.rs +++ b/helix-term/src/ui/context.rs @@ -297,7 +297,7 @@ fn build_cached_nodes( }; context.topmost_byte = context.topmost_byte.saturating_sub( - text.line(text.byte_to_line(popped.byte_range.start)) + text.line(text.try_byte_to_line(popped.byte_range.start).ok()?) .len_bytes(), ); }