Pastey Prevent file list flicker while typing in the editor

# HG changeset patch
# User Guillermo Bonvehi 
# Date 1366386200 10800
# Node ID 8f67119a5c8d543e968179ce42e585adb8f5092f
# Parent  80af786c226669c656208168e179f560978d4b2c
Prevent file list flicker while typing in the editor

diff -r 80af786c2266 -r 8f67119a5c8d files.e
--- a/files.e	Thu Apr 18 12:25:37 2013 -0400
+++ b/files.e	Fri Apr 19 12:43:20 2013 -0300
@@ -1013,14 +1013,22 @@
 
 export procedure list_image( atom tree, integer item, integer image )
 	integer pos
+	integer changed
+	integer current_image
+	changed = 0
 	for i = 0 to 3 do
-		set_tree_item_image( tree, file_tree_id[item], image, i  )
+		current_image = get_tree_item_image( tree, file_tree_id[item], i )
+		if current_image != image then
+			changed = 1
+			set_tree_item_image( tree, file_tree_id[item], image, i  )
+		end if
 	end for
--- 	set_list_item_image( list, item, image)
-	pos = get_splitter_sash_position( main_splitter )
-	-- The list control doesn't redraw correctly under wxGTK until
-	-- after it gets resized (even though we don't really resize it here).
-	set_splitter_sash_position( main_splitter, pos, 0 )
+	if changed = 1 then
+		pos = get_splitter_sash_position( main_splitter )
+		-- The list control doesn't redraw correctly under wxGTK until
+		-- after it gets resized (even though we don't really resize it here).
+		set_splitter_sash_position( main_splitter, pos, 0 )
+	end if
 end procedure
 
 export procedure new()