@@ -183,6 +183,7 @@ impl EditorView {
183183 .highlight_iter(text.slice(..), Some(range), None)
184184 .map(|event| event.unwrap())
185185 .map(move |event| match event {
186+ // TODO: use byte slices directly
186187 // convert byte offsets to char offset
187188 HighlightEvent::Source { start, end } => {
188189 let start =
@@ -317,6 +318,8 @@ impl EditorView {
317318 theme: &Theme,
318319 highlights: H,
319320 ) {
321+ // It's slightly more efficient to produce a full RopeSlice from the Rope, then slice that a bunch
322+ // of times than it is to always call Rope::slice/get_slice (it will internally always hit RSEnum::Light).
320323 let text = doc.text().slice(..);
321324
322325 let mut spans = Vec::new();
@@ -327,10 +330,6 @@ impl EditorView {
327330
328331 let text_style = theme.get("ui.text");
329332
330− // It's slightly more efficient to produce a full RopeSlice from the Rope, then slice that a bunch
331− // of times than it is to always call Rope::slice/get_slice (it will internally always hit RSEnum::Light).
332− let text = text.slice(..);
333−
334333 'outer: for event in highlights {
335334 match event {
336335 HighlightEvent::HighlightStart(span) => {