diff src/luan_editor/window.luan @ 48:ca5ae0a36db7

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 20 May 2025 20:16:58 -0600
parents f66f704118e3
children c17c5312e8de
line wrap: on
line diff
--- a/src/luan_editor/window.luan	Tue May 20 19:07:30 2025 -0600
+++ b/src/luan_editor/window.luan	Tue May 20 20:16:58 2025 -0600
@@ -152,7 +152,7 @@
 	end
 	text_area.set_selection(0)
 	local list_window_item = {
-		text = title
+		--text = title
 		window = window
 	}
 	add_list_window_item(list_window_item)
@@ -214,6 +214,7 @@
 			s = s.." *"
 		end
 		frame.title = s
+		list_window_item.text = title
 		list_window_item.foreground_color = is_unedited and black or dark_blue
 		list_view.repaint(list_window_item)
 	end
@@ -221,6 +222,9 @@
 	--window.undo_listener = undo_listener  -- dont gc
 	text_area.document.add_undo_listener(undo_listener)
 	window.new = new_window
+	function window.title()
+		return title
+	end
 	function window.open()
 		local new_file = choose_file{
 			action = "load"
@@ -241,8 +245,9 @@
 				return false
 			end
 			title = file.canonical().to_string()
-			frame.title = title
 			documents[title] = text_area.document
+			window.is_unedited = nil
+			undo_listener()
 		end
 		try
 			file.write_text(text_area.text)