Chamo.Sourceview
The sourceview view, to edit any text file.
get_att name pairs
return the value associated to the given name in the given list of pairs, or None if no value is associated to the name.
Same as get_att
but apply the given function on the value associated to the name.
Return the language associated to the given filename, according to the Sourceview_rc.filename_language_patterns
option.
Return an UTF-8 string from the given filename.
val location_of_string : string -> location option
Parse a location string. Can be of form n
to indicate character number n
, or l,c
to indicate line l
, character c
.
val string_of_location : location -> string
Create a string to represent the given location.
Create a string to represent the given (line, character) location.
The name of the file where to load and store the list of open buffers.
The history of buffers. First element is the most recently used. The list contains the names of buffers.
val pastable_history : Minibuffer.minibuffer_history
An history of pastable text, usable in a minibuffer.
class my_buffer : Stk.Textbuffer.t -> object ... end
class type mode = object ... end
class empty_mode : mode
val register_mode : ?replace:bool -> mode -> unit
Register a mode.
val get_mode : string -> mode
Get the mode with the given name.
Buffered files are buffered associated to a file.
class buffered_file : ?attributes:(string * string) list -> ?xmls:Xml.t list -> ?loc:(int * int) -> name:
string -> filename:string -> my_buffer -> object ... end
TODO: methods acting on buffer contents should be moved to buffered_file
or my_buffer
classes.
class sourceview : ?attributes:(string * string) list -> ?xmls:Xml.t list -> View.topwin -> (
'a ->
unit) -> ('a ->
'b) -> (buffered_file ->
View.topwin ->
View.gui_view) -> (string ->
string ->
unit) -> buffered_file -> object ... end
buffered_files
and modes
Use the Sourceview_rc.filename_mode_patterns
option to get the associated mode name from the given filename.
val mode_of_filename : string -> mode option
Get the mode to use from the given filename, using mode_name_of_filename
.
val views : sourceview list Stdlib.ref
val buffers : buffered_file list Stdlib.ref
val active_sourceview : sourceview option Stdlib.ref
val set_active_sourceview : sourceview -> unit
val create_buffer :
?attributes:(string * string) list ->
?xmls:Xml.t list ->
string ->
buffered_file
val get_buffer :
?attributes:(string * string) list ->
?xmls:Xml.t list ->
string ->
buffered_file
val get_buffer_by_name : string -> buffered_file
val remove_buffer : buffered_file -> unit
val on_view_destroy : sourceview -> unit
val create_view :
?attributes:(string * string) list ->
?xmls:Xml.t list ->
View.topwin ->
buffered_file ->
sourceview
val dup : buffered_file -> View.topwin -> View.gui_view
val open_file :
View.topwin ->
View.gui_view ->
?attributes:(string * string) list ->
?xmls:Xml.t list ->
string ->
[> `New_view of View.gui_view | `Use_view of View.gui_view ]
class factory : Chamo.View.view_factory
val register_com :
prefix:string ->
string ->
string array ->
?more:string ->
(sourceview -> string array -> unit) ->
unit
register_com ~prefix name args ?more f
creates and register a command with name prefix_name
, arguments names args
and command body f
.
val register_com_lwt :
prefix:string ->
string ->
string array ->
?more:string ->
(sourceview -> string array -> unit Lwt.t) ->
unit
Same as register_com
but does not add a Lwt.return
to the given function.
val switch_to_buffer : sourceview -> string -> unit
val switch_buffer_history : Minibuffer.minibuffer_history
val switch_buffer : sourceview -> string array -> unit Lwt.t
val destroy_buffer : sourceview -> 'a -> unit Lwt.t
val paste : sourceview -> string array -> unit
val copy : sourceview -> string array -> unit
val cut : sourceview -> string array -> unit
val beginning_of_line : sourceview -> string array -> unit
val end_of_line : sourceview -> string array -> unit
val undo : sourceview -> string array -> unit
val redo : sourceview -> string array -> unit
val forward_word : sourceview -> string array -> unit
val backward_word : sourceview -> string array -> unit
val forward_line : sourceview -> string array -> unit
val backward_line : sourceview -> string array -> unit
val forward_char : sourceview -> string array -> unit
val backward_char : sourceview -> string array -> unit
val kill_line : sourceview -> string array -> unit
val kill_word : sourceview -> string array -> unit
val backward_kill_word : sourceview -> string array -> unit
val delete_char : sourceview -> string array -> unit
val backward_delete_char : sourceview -> string array -> unit
val transpose_chars : sourceview -> string array -> unit
val transpose_lines : sourceview -> string array -> unit
val transpose_words : sourceview -> string array -> unit
val yank_choose : sourceview -> string array -> unit
val insert : sourceview -> string array -> unit
val goto_history : Minibuffer.minibuffer_history
val goto_line : sourceview -> string array -> unit Lwt.t
val goto_char : sourceview -> string array -> unit Lwt.t
val force_save : sourceview -> string array -> unit Lwt.t
val syntax_mode_history : Minibuffer.minibuffer_history
val set_syntax_mode : sourceview -> string array -> unit Lwt.t
val popup_syntax_mode_choice : sourceview -> string array -> unit
val mode_history : Minibuffer.minibuffer_history
val set_encoding : sourceview -> string array -> unit Lwt.t
val set_mode : sourceview -> string array -> unit Lwt.t
val popup_mode_choice : sourceview -> string array -> unit
val switch_line_numbers : sourceview -> string array -> unit
val switch_line_markers : sourceview -> string array -> unit
val set_wrap_mode : sourceview -> string array -> unit Lwt.t