diff options
author | Dmitry Sharshakov | 2021-08-31 18:29:11 +0000 |
---|---|---|
committer | Dmitry Sharshakov | 2021-08-31 18:29:11 +0000 |
commit | 5b20f6020a4acd74bc545fc27c473f0198354e5d (patch) | |
tree | e826e8ec1b9fefd3d9f979e30c6176f4a7302bf2 /helix-term/src/ui/editor.rs | |
parent | 6265e196b700b363244961ed2957d9eef5460c34 (diff) | |
parent | a3bd80a6fa4f07b0fa581eae416376763ba94345 (diff) |
Merge remote-tracking branch 'origin/master' into debug
Contains type fix on helix-term/src/ui/editor.rs:752:13
Diffstat (limited to 'helix-term/src/ui/editor.rs')
-rw-r--r-- | helix-term/src/ui/editor.rs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 725d58b3..e661c5a0 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -155,21 +155,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 @@ -435,7 +435,7 @@ impl EditorView { let current_line = doc .text() - .char_to_line(doc.selection(view.id).primary().anchor); + .char_to_line(doc.selection(view.id).primary().cursor(text)); // it's used inside an iterator so the collect isn't needless: // https://github.com/rust-lang/rust-clippy/issues/6164 @@ -749,7 +749,7 @@ impl EditorView { _ => noop, }; Prompt::new( - format!("{}: ", name), + format!("{}: ", name).into(), None, completer, move |cx: &mut crate::compositor::Context, input: &str, event: PromptEvent| { |