changeset 87:bf1046456ce9

better find
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 27 Jun 2025 23:08:34 -0600
parents b6ef6aaa9f29
children 9d32b7115fd1
files src/luan_editor/find.luan
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/luan_editor/find.luan	Fri Jun 27 19:44:35 2025 -0600
+++ b/src/luan_editor/find.luan	Fri Jun 27 23:08:34 2025 -0600
@@ -18,6 +18,8 @@
 local browse = Swing.browse or error()
 
 
+local find_text = ""
+
 local function get_matches(text,s)
 	local r = regex(s)
 	local matches = {}
@@ -50,6 +52,7 @@
 			status_bar.text = " "
 			return
 		end
+		find_text = s
 		if not regex_check_box.is_selected then
 			s = regex_quote(s)
 		end
@@ -102,6 +105,7 @@
 			status_bar.text = " "
 			return
 		end
+		find_text = find
 		local replace = replace_field.text
 		if not regex_check_box.is_selected then
 			find = regex_quote(find)
@@ -212,6 +216,7 @@
 	}
 	function window.show_find_panel()
 		find_panel.is_visible = true
+		find_field.text = find_text
 		find_field.request_focus_in_window()
 		find_field.select_all()
 	end