aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorPascal Kuthe2023-05-12 14:49:39 +0000
committerBlaž Hrastnik2023-05-18 06:23:37 +0000
commitb0705337bec836604bdb97689d0a44940c6bddae (patch)
tree4f7e3607cb891f290aae853f938d1db17a1e3c95 /helix-term/src
parent2f2306475cac7ee9385b816424137421c13bf4c2 (diff)
automatically disable TS when parsing takes longer than 500ms
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/ui/markdown.rs2
-rw-r--r--helix-term/src/ui/picker.rs3
2 files changed, 1 insertions, 4 deletions
diff --git a/helix-term/src/ui/markdown.rs b/helix-term/src/ui/markdown.rs
index fea3de78..def64434 100644
--- a/helix-term/src/ui/markdown.rs
+++ b/helix-term/src/ui/markdown.rs
@@ -51,7 +51,7 @@ pub fn highlighted_code_block<'a>(
language.into(),
))
.and_then(|config| config.highlight_config(theme.scopes()))
- .map(|config| Syntax::new(&rope, config, Arc::clone(&config_loader)));
+ .and_then(|config| Syntax::new(&rope, config, Arc::clone(&config_loader)));
let syntax = match syntax {
Some(s) => s,
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs
index 6120bfd1..d161f786 100644
--- a/helix-term/src/ui/picker.rs
+++ b/helix-term/src/ui/picker.rs
@@ -240,12 +240,10 @@ impl<T: Item + 'static> FilePicker<T> {
log::info!("highlighting picker item failed");
return
};
- log::info!("hmm1");
let Some(Overlay { content: picker, .. }) = compositor.find::<Overlay<Self>>() else {
log::info!("picker closed before syntax highlighting finished");
return
};
- log::info!("hmm2");
// Try to find a document in the cache
let doc = match current_file {
PathOrId::Id(doc_id) => doc_mut!(editor, &doc_id),
@@ -254,7 +252,6 @@ impl<T: Item + 'static> FilePicker<T> {
_ => return,
},
};
- log::info!("yay");
doc.syntax = Some(syntax);
};
Callback::EditorCompositor(Box::new(callback))