From f338c46bf79f773ec7a41729270227da8c2660b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20G=C3=B3mez?= Date: Fri, 27 Jun 2025 21:41:17 +0200 Subject: [PATCH] Fix line indices when using a selection in the context (#33549) Closes #33152. The label for a file selection context had an off-by-one error on line indices. This PR adjusts that. Before: Screenshot 2025-06-27 at 20 55 28 After: Screenshot 2025-06-27 at 20 49 35 Release Notes: - Fixed a off-by-one error on the line indices when using a selection as context for the agent, --- crates/agent_ui/src/context_picker.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/agent_ui/src/context_picker.rs b/crates/agent_ui/src/context_picker.rs index b0069a2446..f303f34a52 100644 --- a/crates/agent_ui/src/context_picker.rs +++ b/crates/agent_ui/src/context_picker.rs @@ -930,8 +930,8 @@ impl MentionLink { format!( "[@{} ({}-{})]({}:{}:{}-{})", file_name, - line_range.start, - line_range.end, + line_range.start + 1, + line_range.end + 1, Self::SELECTION, full_path, line_range.start,