From 6336ab43b3a6b52bd4e06f3dce1c7748cd694844 Mon Sep 17 00:00:00 2001 From: Vulpesx Date: Thu, 15 Aug 2024 20:02:05 +1000 Subject: [PATCH] fix random panic found while testing --- helix-view/src/gutter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-view/src/gutter.rs b/helix-view/src/gutter.rs index 36f719f79..bf04244df 100644 --- a/helix-view/src/gutter.rs +++ b/helix-view/src/gutter.rs @@ -287,7 +287,7 @@ fn execution_pause_indicator<'doc>( ) -> GutterFn<'doc> { let style = theme.get("ui.debug.active"); let current_stack_frame = editor.current_stack_frame(); - let frame_line = current_stack_frame.map(|frame| frame.line - 1); + let frame_line = current_stack_frame.and_then(|frame| frame.line.checked_sub(1)); let frame_source_path = current_stack_frame.map(|frame| { frame .source