Fix Find/Replace seeding,
@@ -67,20 +67,20 @@ class FindDialog(CommonDialog):
self.find_label.grid(column=0, row=0, sticky="w", padx=(padx, 0), pady=(pady, 0))
# Find text field
- initial_text = ""
+ seed_text = ""
try:
widget = get_workbench().focus_get()
if isinstance(widget, tk.Text):
selected_lines = widget.selection_get().splitlines()
if selected_lines:
- initial_text = selected_lines[0]
+ seed_text = selected_lines[0]
except Exception:
- logger.exception("Could not get initial text")
+ logger.exception("Could not get seed text")
- self.find_entry_var = tk.StringVar(value=initial_text)
+ self.find_entry_var = tk.StringVar(value=seed_text)
self.find_entry = ttk.Entry(main_frame, textvariable=self.find_entry_var)
self.find_entry.grid(column=1, row=0, columnspan=2, padx=(0, 10), pady=(pady, 0))
- if FindDialog.last_searched_word is not None:
+ if not seed_text and FindDialog.last_searched_word is not None:
self.find_entry.insert(0, FindDialog.last_searched_word)
# Replace text label
