From d07074740bc44b71de83cf23dd692fa90c2854a9 Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Sat, 26 Jun 2021 15:37:32 -0700 Subject: Add `Range` methods for various kinds of validation. --- helix-term/src/ui/editor.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'helix-term/src/ui') diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index b55a830e..d2925e35 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -8,7 +8,7 @@ use crate::{ use helix_core::{ coords_at_pos, - graphemes::ensure_grapheme_boundary, + graphemes::ensure_grapheme_boundary_next, syntax::{self, Highlight, HighlightEvent}, LineEnding, Position, Range, }; @@ -144,8 +144,8 @@ impl EditorView { let highlights = highlights.into_iter().map(|event| match event.unwrap() { // convert byte offsets to char offset HighlightEvent::Source { start, end } => { - let start = ensure_grapheme_boundary(text, text.byte_to_char(start)); - let end = ensure_grapheme_boundary(text, text.byte_to_char(end)); + let start = ensure_grapheme_boundary_next(text, text.byte_to_char(start)); + let end = ensure_grapheme_boundary_next(text, text.byte_to_char(end)); HighlightEvent::Source { start, end } } event => event, -- cgit v1.2.3-70-g09d2