]> matita.cs.unibo.it Git - helm.git/commitdiff
when a file is opened the cursor is moved to the begin of the file
authorEnrico Tassi <enrico.tassi@inria.fr>
Sun, 19 Oct 2008 08:21:48 +0000 (08:21 +0000)
committerEnrico Tassi <enrico.tassi@inria.fr>
Sun, 19 Oct 2008 08:21:48 +0000 (08:21 +0000)
helm/software/matita/matitaGui.ml

index c6510403521af1e3cb8a70ba0a6a4ab0cc98ad1c..1fe78046e38d6bb7d70fe0ab4994f0632a522f53 100644 (file)
@@ -843,6 +843,8 @@ class gui () =
               source_view#source_buffer#begin_not_undoable_action ();
               script#loadFromFile f; 
               source_view#source_buffer#end_not_undoable_action ();
+              source_view#buffer#move_mark `INSERT source_view#buffer#start_iter;
+              source_view#buffer#place_cursor source_view#buffer#start_iter;
               console#message ("'"^f^"' loaded.\n");
               self#_enableSaveTo f
           | None -> ()
@@ -1134,6 +1136,8 @@ class gui () =
       source_view#source_buffer#begin_not_undoable_action ();
       script#loadFromFile content;
       source_view#source_buffer#end_not_undoable_action ();
+      source_view#buffer#move_mark `INSERT source_view#buffer#start_iter;
+      source_view#buffer#place_cursor source_view#buffer#start_iter;
       console#message ("'"^file^"' loaded.");
       self#_enableSaveTo file