mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-12-01 19:58:12 +03:00
Fix code indentation (#671)
This commit is contained in:
parent
847d1fa496
commit
03ad9e0bfa
@ -148,21 +148,21 @@ impl EditorView {
|
||||
syntax
|
||||
.highlight_iter(text.slice(..), Some(range), None, |language| {
|
||||
loader
|
||||
.language_config_for_scope(&format!("source.{}", language))
|
||||
.and_then(|language_config| {
|
||||
let config = language_config.highlight_config(scopes)?;
|
||||
let config_ref = config.as_ref();
|
||||
// SAFETY: the referenced `HighlightConfiguration` behind
|
||||
// the `Arc` is guaranteed to remain valid throughout the
|
||||
// duration of the highlight.
|
||||
let config_ref = unsafe {
|
||||
std::mem::transmute::<
|
||||
_,
|
||||
&'static syntax::HighlightConfiguration,
|
||||
>(config_ref)
|
||||
};
|
||||
Some(config_ref)
|
||||
})
|
||||
.language_config_for_scope(&format!("source.{}", language))
|
||||
.and_then(|language_config| {
|
||||
let config = language_config.highlight_config(scopes)?;
|
||||
let config_ref = config.as_ref();
|
||||
// SAFETY: the referenced `HighlightConfiguration` behind
|
||||
// the `Arc` is guaranteed to remain valid throughout the
|
||||
// duration of the highlight.
|
||||
let config_ref = unsafe {
|
||||
std::mem::transmute::<
|
||||
_,
|
||||
&'static syntax::HighlightConfiguration,
|
||||
>(config_ref)
|
||||
};
|
||||
Some(config_ref)
|
||||
})
|
||||
})
|
||||
.map(|event| event.unwrap())
|
||||
.collect() // TODO: we collect here to avoid holding the lock, fix later
|
||||
|
Loading…
Reference in New Issue
Block a user