Simple replace all implementation

This commit is contained in:
Jeremy Soller 2024-01-09 13:40:55 -07:00
parent dd459efe06
commit 55fae767ae
No known key found for this signature in database
GPG key ID: DCFCA852D3906975

View file

@ -1257,7 +1257,15 @@ impl Application for App {
return self.update_focus();
}
Message::FindReplaceAll => {
log::warn!("FIND REPLACE ALL");
if !self.find_search_value.is_empty() {
if let Some(Tab::Editor(tab)) = self.active_tab() {
{
let mut editor = tab.editor.lock().unwrap();
editor.set_cursor(cosmic_text::Cursor::new(0, 0));
}
while tab.replace(&self.find_search_value, &self.find_replace_value) {}
}
}
// Focus correct input
return self.update_focus();