From 8012acc90e6d6ba0e59bb0513dc419a3aa4739bb Mon Sep 17 00:00:00 2001 From: Ariel Davis Date: Sat, 6 May 2023 01:02:37 -0700 Subject: [PATCH] Use a from --- lib/line-index/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/line-index/src/lib.rs b/lib/line-index/src/lib.rs index eecc1edb135..26287212e31 100644 --- a/lib/line-index/src/lib.rs +++ b/lib/line-index/src/lib.rs @@ -161,7 +161,7 @@ impl LineIndex { let mut res: usize = col.into(); if let Some(wide_chars) = self.line_wide_chars.get(&line_col.line) { for c in wide_chars.iter() { - if c.end <= col { + if u32::from(c.end) <= line_col.col { res -= usize::from(c.len()) - c.wide_len(enc); } else { // From here on, all utf16 characters come *after* the character we are mapping,