From ca8ce123e8d77d2ae8ed84d5273a9b554101b0db Mon Sep 17 00:00:00 2001 From: ontley Date: Fri, 9 Feb 2024 16:29:53 +0100 Subject: [PATCH] cargo fmt --- helix-core/src/transaction.rs | 8 ++++++-- helix-term/src/handlers/signature_help.rs | 13 ++++++------- helix-view/src/register.rs | 4 +++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index f5a49cc11..eaf22008e 100644 --- a/helix-core/src/transaction.rs +++ b/helix-core/src/transaction.rs @@ -378,7 +378,9 @@ impl ChangeSet { macro_rules! map { ($map: expr, $i: expr) => { loop { - let Some((pos, assoc)) = positions.peek_mut() else { return; }; + let Some((pos, assoc)) = positions.peek_mut() else { + return; + }; if **pos < old_pos { // Positions are not sorted, revert to the last Operation that // contains this position and continue iterating from there. @@ -405,7 +407,9 @@ impl ChangeSet { debug_assert!(old_pos <= **pos, "Reverse Iter across changeset works"); continue 'outer; } - let Some(new_pos) = $map(**pos, *assoc) else { break; }; + let Some(new_pos) = $map(**pos, *assoc) else { + break; + }; **pos = new_pos; positions.next(); } diff --git a/helix-term/src/handlers/signature_help.rs b/helix-term/src/handlers/signature_help.rs index 3c746548a..1bca1e14c 100644 --- a/helix-term/src/handlers/signature_help.rs +++ b/helix-term/src/handlers/signature_help.rs @@ -118,8 +118,7 @@ pub fn request_signature_help( // Do not show the message if signature help was invoked // automatically on backspace, trigger characters, etc. if invoked == SignatureHelpInvoked::Manual { - editor - .set_error("No configured language server supports signature-help"); + editor.set_error("No configured language server supports signature-help"); } return; }; @@ -264,11 +263,11 @@ fn signature_help_post_insert_char_hook( let (view, doc) = current!(cx.editor); // TODO support multiple language servers (not just the first that is found), likely by merging UI somehow let Some(language_server) = doc - .language_servers_with_feature(LanguageServerFeature::SignatureHelp) - .next() - else { - return Ok(()); - }; + .language_servers_with_feature(LanguageServerFeature::SignatureHelp) + .next() + else { + return Ok(()); + }; let capabilities = language_server.capabilities(); diff --git a/helix-view/src/register.rs b/helix-view/src/register.rs index 5592c6afd..1e6680150 100644 --- a/helix-view/src/register.rs +++ b/helix-view/src/register.rs @@ -233,7 +233,9 @@ fn read_from_clipboard<'a>( // If we're pasting the same values that we just yanked, re-use // the saved values. This allows pasting multiple selections // even when yanked to a clipboard. - let Some(values) = saved_values else { return RegisterValues::new(iter::once(contents.into())) }; + let Some(values) = saved_values else { + return RegisterValues::new(iter::once(contents.into())); + }; if contents_are_saved(values, &contents) { RegisterValues::new(values.iter().map(Cow::from).rev())