From 21e0afabee67d6363a0b3a47df8707871621534d Mon Sep 17 00:00:00 2001 From: kirawi <67773714+kirawi@users.noreply.github.com> Date: Fri, 26 Apr 2024 09:56:06 -0400 Subject: [PATCH] wip --- helix-term/src/ui/editor.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index c3c41dda3b71..f2d7e484627c 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -21,6 +21,7 @@ use helix_core::{ unicode::width::UnicodeWidthStr, visual_offset_from_block, Change, Position, Range, Selection, Transaction, }; +use helix_stdx::rope::RopeSliceExt; use helix_view::{ document::{Mode, SavePoint, SCRATCH_BUFFER_NAME}, editor::{CompleteAction, CursorShapeConfig}, @@ -386,8 +387,8 @@ impl EditorView { let mut spans = syntax.rainbow_spans(text, Some(syntax_node_range), theme.rainbow_length()); for (_highlight, range) in spans.iter_mut() { - let start = text.byte_to_char(range.start); - let end = text.byte_to_char(range.end); + let start = range.start; + let end = range.end; *range = start..end; }