on master help sign in
Fix silly mistake in previous phantom line bug fix.
a6cadddNathan Vegdahl
helix-core/src/graphemes.rs−14
@@ -131,20 +131,6 @@ pub fn ensure_grapheme_boundary(slice: RopeSlice, char_idx: usize) -> usize {
131 }
131 }
132}
132}
133
133
134−/// Returns the passed byte index if it's already a grapheme boundary,
135−/// or the next grapheme boundary byte index if not.
136−pub fn ensure_grapheme_boundary_byte(slice: RopeSlice, byte_idx: usize) -> usize {
137− // TODO: we can avoid the byte/char conversions entirely
138− // if we also make byte versions of the other functions.
139− let char_idx = slice.byte_to_char(byte_idx);
140− let fixed_char_idx = ensure_grapheme_boundary(slice, char_idx);
141− if fixed_char_idx == char_idx {
142− byte_idx
143− } else {
144− slice.char_to_byte(fixed_char_idx)
145− }
146−}
147−
148/// Returns whether the given char position is a grapheme boundary.
134/// Returns whether the given char position is a grapheme boundary.
149pub fn is_grapheme_boundary(slice: RopeSlice, char_idx: usize) -> bool {
135pub fn is_grapheme_boundary(slice: RopeSlice, char_idx: usize) -> bool {
150 // Bounds check
136 // Bounds check
helix-term/src/ui/editor.rs+1−2
@@ -8,7 +8,7 @@ use crate::{
8
8
9use helix_core::{
9use helix_core::{
10 coords_at_pos,
10 coords_at_pos,
11− graphemes::{ensure_grapheme_boundary, ensure_grapheme_boundary_byte},
11+ graphemes::ensure_grapheme_boundary,
12 syntax::{self, HighlightEvent},
12 syntax::{self, HighlightEvent},
13 LineEnding, Position, Range,
13 LineEnding, Position, Range,
14};
14};
@@ -143,7 +143,6 @@ impl EditorView {
143 'outer: for event in highlights {
143 'outer: for event in highlights {
144 match event.unwrap() {
144 match event.unwrap() {
145 HighlightEvent::HighlightStart(mut span) => {
145 HighlightEvent::HighlightStart(mut span) => {
146− span.0 = ensure_grapheme_boundary_byte(text, span.0);
147 spans.push(span);
146 spans.push(span);
148 }
147 }
149 HighlightEvent::HighlightEnd => {
148 HighlightEvent::HighlightEnd => {