Simple replace all implementation
This commit is contained in:
parent
dd459efe06
commit
55fae767ae
1 changed files with 9 additions and 1 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue