diff options
Diffstat (limited to 'helix-term/src/ui/markdown.rs')
-rw-r--r-- | helix-term/src/ui/markdown.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/helix-term/src/ui/markdown.rs b/helix-term/src/ui/markdown.rs index def64434..cb2abf68 100644 --- a/helix-term/src/ui/markdown.rs +++ b/helix-term/src/ui/markdown.rs @@ -10,7 +10,7 @@ use pulldown_cmark::{CodeBlockKind, Event, HeadingLevel, Options, Parser, Tag}; use helix_core::{ syntax::{self, HighlightEvent, InjectionLanguageMarker, Syntax}, - Rope, + RopeSlice, }; use helix_view::{ graphics::{Margin, Rect, Style}, @@ -45,13 +45,13 @@ pub fn highlighted_code_block<'a>( None => return styled_multiline_text(text, code_style), }; - let rope = Rope::from(text.as_ref()); + let ropeslice = RopeSlice::from(text); let syntax = config_loader .language_configuration_for_injection_string(&InjectionLanguageMarker::Name( language.into(), )) .and_then(|config| config.highlight_config(theme.scopes())) - .and_then(|config| Syntax::new(&rope, config, Arc::clone(&config_loader))); + .and_then(|config| Syntax::new(ropeslice, config, Arc::clone(&config_loader))); let syntax = match syntax { Some(s) => s, @@ -59,7 +59,7 @@ pub fn highlighted_code_block<'a>( }; let highlight_iter = syntax - .highlight_iter(rope.slice(..), None, None) + .highlight_iter(ropeslice, None, None) .map(|e| e.unwrap()); let highlight_iter: Box<dyn Iterator<Item = HighlightEvent>> = if let Some(spans) = additional_highlight_spans { |