exception UseLibrary;;
let rec interactive_error_interp ~all_passes
- (source_buffer:GSourceView.source_buffer) notify_exn offset errorll filename
+ (source_buffer:GSourceView2.source_buffer) notify_exn offset errorll filename
=
(* hook to save a script for each disambiguation error *)
if false then
[ main#mainWinEventBox ]
in
let console = new console ~buffer:main#logTextView#buffer () in
- let (source_view: GSourceView.source_view) =
- GSourceView.source_view
+ let (source_view: GSourceView2.source_view) =
+ GSourceView2.source_view
~auto_indent:true
- ~insert_spaces_instead_of_tabs:true ~tabs_width:2
- ~margin:80 ~show_margin:true
- ~smart_home_end:true
+ ~insert_spaces_instead_of_tabs:true ~tab_width:2
+ ~right_margin_position:80 ~show_right_margin:true
+ ~smart_home_end:`AFTER
~packing:main#scriptScrolledWin#add
()
in
source_view#misc#grab_focus ()
in
connect_menu_item main#undoMenuItem safe_undo;
+(*CSC: XXX
ignore(source_view#source_buffer#connect#can_undo
~callback:main#undoMenuItem#misc#set_sensitive);
+*) main#undoMenuItem#misc#set_sensitive true;
connect_menu_item main#redoMenuItem safe_redo;
+(*CSC: XXX
ignore(source_view#source_buffer#connect#can_redo
~callback:main#redoMenuItem#misc#set_sensitive);
+*) main#redoMenuItem#misc#set_sensitive true;
ignore(source_view#connect#after#populate_popup
~callback:(fun pre_menu ->
let menu = new GMenu.menu pre_menu in
else raise exn);
(* script *)
let _ =
- match GSourceView.source_language_from_file BuildTimeConf.lang_file with
+ let source_language_manager =
+ GSourceView2.source_language_manager ~default:true in
+ source_language_manager#set_search_path[BuildTimeConf.runtime_base_dir];
+ match source_language_manager#language "grafite" with
| None ->
- HLog.warn (sprintf "can't load language file %s"
- BuildTimeConf.lang_file)
- | Some matita_lang ->
+ HLog.warn(sprintf "can't load a language file for \"grafite\" in %s"
+ BuildTimeConf.runtime_base_dir)
+ | Some x as matita_lang ->
source_buffer#set_language matita_lang;
- source_buffer#set_highlight true
+ source_buffer#set_highlight_syntax true
in
let disableSave () =
(s())#assignFileName None;
self#main#saveMenuItem#misc#set_sensitive true
method console = console
- method sourceView: GSourceView.source_view =
- (source_view: GSourceView.source_view)
+ method sourceView: GSourceView2.source_view =
+ (source_view: GSourceView2.source_view)
method fileSel = fileSel
method findRepl = findRepl
method main = main