From d9c88460e448efab4f784187f8bcf95c5a945673 Mon Sep 17 00:00:00 2001 From: Ariel Davis Date: Thu, 4 May 2023 16:38:35 -0700 Subject: [PATCH] Use cur --- lib/line-index/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/line-index/src/lib.rs b/lib/line-index/src/lib.rs index bd00519d4e2..1a4753cbd67 100644 --- a/lib/line-index/src/lib.rs +++ b/lib/line-index/src/lib.rs @@ -86,14 +86,14 @@ impl LineIndex { let mut newlines = Vec::with_capacity(16); newlines.push(TextSize::from(0)); - let mut curr_row = 0.into(); - let mut curr_col = 0.into(); + let mut cur_row = 0.into(); + let mut cur_col = 0.into(); let mut line = 0; for c in text.chars() { let c_len = TextSize::of(c); - curr_row += c_len; + cur_row += c_len; if c == '\n' { - newlines.push(curr_row); + newlines.push(cur_row); // Save any utf-16 characters seen in the previous line if !wide_chars.is_empty() { @@ -101,16 +101,16 @@ impl LineIndex { } // Prepare for processing the next line - curr_col = 0.into(); + cur_col = 0.into(); line += 1; continue; } if !c.is_ascii() { - wide_chars.push(WideChar { start: curr_col, end: curr_col + c_len }); + wide_chars.push(WideChar { start: cur_col, end: cur_col + c_len }); } - curr_col += c_len; + cur_col += c_len; } // Save any utf-16 characters seen in the last line