Stk.TextviewSourceTextview widget.
Widget to display text buffers.
Additional information can be displayed in a gutter on the left: for line numbers and line markers.
This module has its own Logs source "stk.textview". See Log.
include Log.LOGinclude Logs.LOGval msg : Logs.level -> 'a Logs.logSee Logs.msg.
val app : 'a Logs.logapp is msg App.
val err : 'a Logs.logerr is msg Error.
val warn : 'a Logs.logwarn is msg Warning.
val info : 'a Logs.loginfo is msg Info.
val debug : 'a Logs.logdebug is msg Debug.
val kmsg : (unit -> 'b) -> Logs.level -> ('a, 'b) Logs.msgf -> 'bSee Logs.kmsg.
result value Errorsval on_error :
?level:Logs.level ->
?header:string ->
?tags:Logs.Tag.set ->
pp:(Format.formatter -> 'b -> unit) ->
use:('b -> 'a) ->
('a, 'b) result ->
'aSee Logs.on_error.
val on_error_msg :
?level:Logs.level ->
?header:string ->
?tags:Logs.Tag.set ->
use:(unit -> 'a) ->
('a, [ `Msg of string ]) result ->
'aSee Logs.on_error_msg.
val set_level : Logs.level option -> unitProperty "show_cursors" to indicate whether cursors should be rendered. Default is true. Inherited.
Wrap mode for lines longer than available width:
Wrap_none: do not wrap lines.Wrap_char: wrap lines on any char.Ocf.wrapper for wrap_mode.
Property "wrap_mode". Default is Wrap_none. Not inherited.
val css_wrap_mode_prop :
?inherited:bool ->
?def:wrap_mode ->
wrap_mode Props.prop ->
wrap_mode Css.P.propProperty "wrap_char_codepoint" to specify which character to display to indicate a line wrap. Default is 45 ('-'). Inherited.
Property "show_line_numbers" to specify whether line numbers must be display in the gutter. Default is false. Inherited.
Property "show_line_markers" to specify whether line markers must be display in the gutter. Default is false. Inherited.
Property "gutter_props" to specify gutter properties, typically background and foreground colors. Inherited.
Property "highlight_current_line" to specify whether current line (the line with the insert cursor) should be highlighted. Default is false. Inherited.
class textview : ?classes:string list option -> ?name:string option -> ?props:Props.t option -> ?wdata:
Widget.wdata
option -> ?buffer:B.t option -> unit -> object ... endA widget to display the contents of a text buffer. If no buffer is provided, a new one is created.
val textview :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?buffer:B.t ->
?highlight_current_line:bool ->
?show_cursors:bool ->
?show_line_numbers:bool ->
?show_line_markers:bool ->
?wrap_mode:wrap_mode ->
?editable:bool ->
?tagtheme:string ->
?handle_lang_tags:bool ->
?pack:(Widget.widget -> unit) ->
unit ->
textviewConvenient function to create a textview. An existing buffer to use can be specified with optional argument buffer. Properties highlight_current_line, show_cursors, show_line_markers, show_line_numbers, wrap_mode, tagtheme and Props.editable can be specified with the corresponding optional arguments. handle_lang_tags indicates whether to add Texttag.Lang.tags as handled tags (default is false. See Widget arguments for other arguments.
val set_default_key_bindings :
?display_state:(after_handler:bool -> Wkey.keyhit_state -> unit) ->
textview ->
unitset_default_key_bindings textview add some key bindings to textview. Optional argument display_state is a function to call to display the state of keyboard hitstate tree. The keybindings added are:
C-e: move cursor to line end,S/C-a: move cursor to line start,S/C-right: move cursor to next word end,S/C-left: move cursor to previous word start,C-c: copy selection to clipboard,C-x: cut selection to clipboard,C-v: paste clipboard.