aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
authorNathan Vegdahl2021-06-26 22:37:32 +0000
committerNathan Vegdahl2021-07-01 21:22:28 +0000
commitd07074740bc44b71de83cf23dd692fa90c2854a9 (patch)
tree941542d44d101bebc082151ba924fe10888d2d38 /helix-term/src/ui
parentc1b0a7197556ec0383d6b0d0e7f510ecf4dcd21f (diff)
Add `Range` methods for various kinds of validation.
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/editor.rs6
1 files changed, 3 insertions, 3 deletions
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,