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:
parent
46645b552f
commit
3b823d4a0b
8 changed files with 137 additions and 19 deletions
|
@ -5,6 +5,8 @@ use project::search::SearchQuery;
|
|||
pub use project_search::ProjectSearchView;
|
||||
use ui::{prelude::*, Tooltip};
|
||||
use ui::{ButtonStyle, IconButton};
|
||||
use workspace::notifications::NotificationId;
|
||||
use workspace::{Toast, Workspace};
|
||||
|
||||
pub mod buffer_search;
|
||||
pub mod project_search;
|
||||
|
@ -107,3 +109,21 @@ impl SearchOptions {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn show_no_more_matches(cx: &mut WindowContext) {
|
||||
cx.defer(|cx| {
|
||||
struct NotifType();
|
||||
let notification_id = NotificationId::unique::<NotifType>();
|
||||
let Some(workspace) = cx.window_handle().downcast::<Workspace>() else {
|
||||
return;
|
||||
};
|
||||
workspace
|
||||
.update(cx, |workspace, cx| {
|
||||
workspace.show_toast(
|
||||
Toast::new(notification_id.clone(), "No more matches").autohide(),
|
||||
cx,
|
||||
);
|
||||
})
|
||||
.ok();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue