Add simple support for wrapscan (#13497)

For: #13417 

This is a simple version, I'm not sure if we just need to limit this
feature to vim mode, or maybe in normal editor mode, which involves
other logic like the location of the setting

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Hans 2024-07-11 10:42:37 +08:00 committed by GitHub
parent 46645b552f
commit 3b823d4a0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 137 additions and 19 deletions

View file

@ -218,9 +218,11 @@ impl_actions!(
]
);
#[derive(Clone)]
pub struct Toast {
id: NotificationId,
msg: Cow<'static, str>,
autohide: bool,
on_click: Option<(Cow<'static, str>, Arc<dyn Fn(&mut WindowContext)>)>,
}
@ -230,6 +232,7 @@ impl Toast {
id,
msg: msg.into(),
on_click: None,
autohide: false,
}
}
@ -241,6 +244,11 @@ impl Toast {
self.on_click = Some((message.into(), Arc::new(on_click)));
self
}
pub fn autohide(mut self) -> Self {
self.autohide = true;
self
}
}
impl PartialEq for Toast {
@ -251,16 +259,6 @@ impl PartialEq for Toast {
}
}
impl Clone for Toast {
fn clone(&self) -> Self {
Toast {
id: self.id.clone(),
msg: self.msg.clone(),
on_click: self.on_click.clone(),
}
}
}
#[derive(Debug, Default, Clone, Deserialize, PartialEq)]
pub struct OpenTerminal {
pub working_directory: PathBuf,