diff src/luan_editor/Window.luan @ 68:694359b01e06

fix unindent
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 10 Jun 2025 20:32:40 -0600
parents 2c050fcf2614
children 3867e9e1b94c
line wrap: on
line diff
--- a/src/luan_editor/Window.luan	Fri Jun 06 18:59:44 2025 -0600
+++ b/src/luan_editor/Window.luan	Tue Jun 10 20:32:40 2025 -0600
@@ -199,7 +199,7 @@
 			Luan.exit()
 		end
 		remove_list_window_item(list_window_item)
-		local document_info = documents[title] or error()
+		local document_info = documents[title] or error(title)
 		document_info.count = document_info.count - 1
 		if document_info.count == 0 then
 			documents[title] = nil
@@ -312,7 +312,7 @@
 		local text = r.text
 		text = "\n"..text
 		local start_seletion = r.start_seletion
-		if starts_with(text,"\n\t") then
+		if starts_with(text,"\n\t") and start_seletion > r.start_pos then
 			start_seletion = start_seletion - 1
 		end
 		local len1 = #text