diff --git a/calcifer_save.json b/calcifer_save.json index 5b4d04e..d227408 100644 --- a/calcifer_save.json +++ b/calcifer_save.json @@ -1 +1 @@ -{"tabs":["/home/penwing/Documents/notes/victory2.txt","untitled"],"theme":6} \ No newline at end of file +{"tabs":["/home/penwing/Documents/notes/victory2.txt"],"theme":6} \ No newline at end of file diff --git a/src/tools/search.rs b/src/tools/search.rs index 404a59f..b7fda5f 100644 --- a/src/tools/search.rs +++ b/src/tools/search.rs @@ -211,10 +211,15 @@ impl SearchWindow { if self.searched_text != self.search_text { self.search(tabs, &mut *selected_tab); } - + + let mut done : Vec = vec![]; for element in &self.results { + if done.contains(&element.tab) { + continue; + } tabs[element.tab.to_index()].code = tabs[element.tab.to_index()].code.replace(&self.search_text, &self.replace_text); tabs[element.tab.to_index()].saved = false; + done.push(element.tab.clone()) } } } \ No newline at end of file