mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
cargo fmt
This commit is contained in:
parent
334af9ce5d
commit
ca8ce123e8
@ -378,7 +378,9 @@ pub fn update_positions<'a>(&self, positions: impl Iterator<Item = (&'a mut usiz
|
|||||||
macro_rules! map {
|
macro_rules! map {
|
||||||
($map: expr, $i: expr) => {
|
($map: expr, $i: expr) => {
|
||||||
loop {
|
loop {
|
||||||
let Some((pos, assoc)) = positions.peek_mut() else { return; };
|
let Some((pos, assoc)) = positions.peek_mut() else {
|
||||||
|
return;
|
||||||
|
};
|
||||||
if **pos < old_pos {
|
if **pos < old_pos {
|
||||||
// Positions are not sorted, revert to the last Operation that
|
// Positions are not sorted, revert to the last Operation that
|
||||||
// contains this position and continue iterating from there.
|
// contains this position and continue iterating from there.
|
||||||
@ -405,7 +407,9 @@ macro_rules! map {
|
|||||||
debug_assert!(old_pos <= **pos, "Reverse Iter across changeset works");
|
debug_assert!(old_pos <= **pos, "Reverse Iter across changeset works");
|
||||||
continue 'outer;
|
continue 'outer;
|
||||||
}
|
}
|
||||||
let Some(new_pos) = $map(**pos, *assoc) else { break; };
|
let Some(new_pos) = $map(**pos, *assoc) else {
|
||||||
|
break;
|
||||||
|
};
|
||||||
**pos = new_pos;
|
**pos = new_pos;
|
||||||
positions.next();
|
positions.next();
|
||||||
}
|
}
|
||||||
|
@ -118,8 +118,7 @@ pub fn request_signature_help(
|
|||||||
// Do not show the message if signature help was invoked
|
// Do not show the message if signature help was invoked
|
||||||
// automatically on backspace, trigger characters, etc.
|
// automatically on backspace, trigger characters, etc.
|
||||||
if invoked == SignatureHelpInvoked::Manual {
|
if invoked == SignatureHelpInvoked::Manual {
|
||||||
editor
|
editor.set_error("No configured language server supports signature-help");
|
||||||
.set_error("No configured language server supports signature-help");
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
@ -264,11 +263,11 @@ fn signature_help_post_insert_char_hook(
|
|||||||
let (view, doc) = current!(cx.editor);
|
let (view, doc) = current!(cx.editor);
|
||||||
// TODO support multiple language servers (not just the first that is found), likely by merging UI somehow
|
// TODO support multiple language servers (not just the first that is found), likely by merging UI somehow
|
||||||
let Some(language_server) = doc
|
let Some(language_server) = doc
|
||||||
.language_servers_with_feature(LanguageServerFeature::SignatureHelp)
|
.language_servers_with_feature(LanguageServerFeature::SignatureHelp)
|
||||||
.next()
|
.next()
|
||||||
else {
|
else {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
|
|
||||||
let capabilities = language_server.capabilities();
|
let capabilities = language_server.capabilities();
|
||||||
|
|
||||||
|
@ -233,7 +233,9 @@ fn read_from_clipboard<'a>(
|
|||||||
// If we're pasting the same values that we just yanked, re-use
|
// If we're pasting the same values that we just yanked, re-use
|
||||||
// the saved values. This allows pasting multiple selections
|
// the saved values. This allows pasting multiple selections
|
||||||
// even when yanked to a clipboard.
|
// 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) {
|
if contents_are_saved(values, &contents) {
|
||||||
RegisterValues::new(values.iter().map(Cow::from).rev())
|
RegisterValues::new(values.iter().map(Cow::from).rev())
|
||||||
|
Loading…
Reference in New Issue
Block a user