Skip to content

Commit

Permalink
Simple replace all implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Jan 9, 2024
1 parent dd459ef commit 55fae76
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 55fae76

Please sign in to comment.