@@ -148,21 +148,21 @@ impl EditorView {
148148 syntax
149149 .highlight_iter(text.slice(..), Some(range), None, |language| {
150150 loader
151− .language_config_for_scope(&format!("source.{}", language))
152− .and_then(|language_config| {
153− let config = language_config.highlight_config(scopes)?;
154− let config_ref = config.as_ref();
155− // SAFETY: the referenced `HighlightConfiguration` behind
156− // the `Arc` is guaranteed to remain valid throughout the
157− // duration of the highlight.
158− let config_ref = unsafe {
159− std::mem::transmute::<
160− _,
161− &'static syntax::HighlightConfiguration,
162− >(config_ref)
163− };
164− Some(config_ref)
165− })
151+ .language_config_for_scope(&format!("source.{}", language))
152+ .and_then(|language_config| {
153+ let config = language_config.highlight_config(scopes)?;
154+ let config_ref = config.as_ref();
155+ // SAFETY: the referenced `HighlightConfiguration` behind
156+ // the `Arc` is guaranteed to remain valid throughout the
157+ // duration of the highlight.
158+ let config_ref = unsafe {
159+ std::mem::transmute::<
160+ _,
161+ &'static syntax::HighlightConfiguration,
162+ >(config_ref)
163+ };
164+ Some(config_ref)
165+ })
166166 })
167167 .map(|event| event.unwrap())
168168 .collect() // TODO: we collect here to avoid holding the lock, fix later