From b10c82c01540273a33137cec59571ff14f8f0586 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 18 Nov 2021 09:52:05 +0100 Subject: [PATCH] Stop at `range.end` when computing text summary for range in TabMap --- crates/editor/src/display_map/tab_map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/editor/src/display_map/tab_map.rs b/crates/editor/src/display_map/tab_map.rs index a5b614e506..b864019033 100644 --- a/crates/editor/src/display_map/tab_map.rs +++ b/crates/editor/src/display_map/tab_map.rs @@ -130,7 +130,7 @@ impl Snapshot { last_line_chars = first_line_chars; } else { for _ in self - .chunks(TabPoint::new(range.end.row(), 0)..self.max_point(), false) + .chunks(TabPoint::new(range.end.row(), 0)..range.end, false) .flat_map(|chunk| chunk.text.chars()) { last_line_chars += 1;