aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/completion.rs16
-rw-r--r--helix-term/src/ui/picker.rs11
2 files changed, 20 insertions, 7 deletions
diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs
index c7f9250d..e0614722 100644
--- a/helix-term/src/ui/completion.rs
+++ b/helix-term/src/ui/completion.rs
@@ -144,7 +144,9 @@ impl Completion {
}
};
- let Some(range) = util::lsp_range_to_range(doc.text(), edit.range, offset_encoding) else{
+ let Some(range) =
+ util::lsp_range_to_range(doc.text(), edit.range, offset_encoding)
+ else {
return Transaction::new(doc.text());
};
@@ -413,10 +415,18 @@ impl Completion {
_ => return false,
};
- let Some(language_server) = cx.editor.language_server_by_id(current_item.language_server_id) else { return false; };
+ let Some(language_server) = cx
+ .editor
+ .language_server_by_id(current_item.language_server_id)
+ else {
+ return false;
+ };
// This method should not block the compositor so we handle the response asynchronously.
- let Some(future) = language_server.resolve_completion_item(current_item.item.clone()) else { return false; };
+ let Some(future) = language_server.resolve_completion_item(current_item.item.clone())
+ else {
+ return false;
+ };
cx.callback(
future,
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs
index 4605e2f1..f80bc512 100644
--- a/helix-term/src/ui/picker.rs
+++ b/helix-term/src/ui/picker.rs
@@ -432,7 +432,7 @@ impl<T: Item + 'static> Picker<T> {
fn handle_idle_timeout(&mut self, cx: &mut Context) -> EventResult {
let Some((current_file, _)) = self.current_file(cx.editor) else {
- return EventResult::Consumed(None)
+ return EventResult::Consumed(None);
};
// Try to find a document in the cache
@@ -459,11 +459,14 @@ impl<T: Item + 'static> Picker<T> {
let callback = move |editor: &mut Editor, compositor: &mut Compositor| {
let Some(syntax) = syntax else {
log::info!("highlighting picker item failed");
- return
+ return;
};
- let Some(Overlay { content: picker, .. }) = compositor.find::<Overlay<Self>>() else {
+ let Some(Overlay {
+ content: picker, ..
+ }) = compositor.find::<Overlay<Self>>()
+ else {
log::info!("picker closed before syntax highlighting finished");
- return
+ return;
};
// Try to find a document in the cache
let doc = match current_file {