Textadept
- Home |
- Download |
- Lua API |
- Source |
- Language Modules |
- Stats |
- Wiki |
- Mailing List
Contents
- buffer
- Fields
- additional_caret_fore
- additional_carets_blink
- additional_carets_visible
- additional_sel_alpha
- additional_sel_back
- additional_sel_fore
- additional_selection_typing
- anchor
- annotation_lines
- annotation_style
- annotation_style_offset
- annotation_visible
- auto_c_auto_hide
- auto_c_cancel_at_start
- auto_c_case_insensitive
- auto_c_choose_single
- auto_c_drop_rest_of_word
- auto_c_fill_ups
- auto_c_ignore_case
- auto_c_max_height
- auto_c_max_width
- auto_c_separator
- auto_c_type_separator
- back_space_un_indents
- buffered_draw
- call_tip_back
- call_tip_fore
- call_tip_fore_hlt
- call_tip_position
- call_tip_use_style
- caret_fore
- caret_line_back
- caret_line_back_alpha
- caret_line_visible
- caret_period
- caret_sticky
- caret_style
- caret_width
- char_at
- code_page
- column
- control_char_symbol
- current_pos
- cursor
- direct_function
- direct_pointer
- dirty
- edge_colour
- edge_column
- edge_mode
- encoding
- encoding_bom
- end_at_last_line
- end_styled
- eol_mode
- extra_ascent
- extra_descent
- filename
- first_visible_line
- focus
- fold_expanded
- fold_level
- fold_parent
- font_quality
- gap_position
- h_scroll_bar
- highlight_guide
- hotspot_active_underline
- hotspot_single_line
- indent
- indentation_guides
- indic_alpha
- indic_fore
- indic_outline_alpha
- indic_style
- indic_under
- indicator_current
- indicator_value
- keys_unicode
- layout_cache
- length
- lexer
- line_count
- line_end_position
- line_indent_position
- line_indentation
- line_state
- line_visible
- lines_on_screen
- lines_visible
- main_selection
- margin_cursor_n
- margin_left
- margin_mask_n
- margin_options
- margin_right
- margin_sensitive_n
- margin_style
- margin_style_offset
- margin_type_n
- margin_width_n
- max_line_state
- modify
- mouse_down_captures
- mouse_dwell_time
- multi_paste
- multiple_selection
- overtype
- position_cache
- print_colour_mode
- print_magnification
- print_wrap_mode
- property
- property_int
- read_only
- rectangular_selection_anchor
- rectangular_selection_anchor_virtual_space
- rectangular_selection_caret
- rectangular_selection_caret_virtual_space
- rectangular_selection_modifier
- rgba_image_height
- rgba_image_width
- scroll_width
- scroll_width_tracking
- search_flags
- sel_alpha
- sel_eol_filled
- selection_end
- selection_is_rectangle
- selection_mode
- selection_n_anchor
- selection_n_anchor_virtual_space
- selection_n_caret
- selection_n_caret_virtual_space
- selection_n_end
- selection_n_start
- selection_start
- selections
- status
- style_at
- style_back
- style_bits
- style_bits_needed
- style_bold
- style_case
- style_changeable
- style_character_set
- style_eol_filled
- style_font
- style_fore
- style_hot_spot
- style_italic
- style_size
- style_size_fractional
- style_underline
- style_visible
- style_weight
- tab_indents
- tab_width
- target_end
- target_start
- text_length
- two_phase_draw
- undo_collection
- use_tabs
- v_scroll_bar
- view_eol
- view_ws
- virtual_space_options
- whitespace_chars
- whitespace_size
- word_chars
- wrap_indent_mode
- wrap_mode
- wrap_start_indent
- wrap_visual_flags
- wrap_visual_flags_location
- x_offset
- zoom
- Functions
- buffer.add_selection
- buffer.add_text
- buffer.allocate
- buffer.annotation_clear_all
- buffer.annotation_get_text
- buffer.annotation_set_text
- buffer.append_text
- buffer.auto_c_active
- buffer.auto_c_cancel
- buffer.auto_c_complete
- buffer.auto_c_get_current
- buffer.auto_c_get_current_text
- buffer.auto_c_pos_start
- buffer.auto_c_select
- buffer.auto_c_show
- buffer.auto_c_stops
- buffer.back_tab
- buffer.begin_undo_action
- buffer.brace_bad_light
- buffer.brace_bad_light_indicator
- buffer.brace_highlight
- buffer.brace_highlight_indicator
- buffer.brace_match
- buffer.call_tip_active
- buffer.call_tip_cancel
- buffer.call_tip_pos_start
- buffer.call_tip_set_hlt
- buffer.call_tip_show
- buffer.can_paste
- buffer.can_redo
- buffer.can_undo
- buffer.cancel
- buffer.change_lexer_state
- buffer.char_left
- buffer.char_left_extend
- buffer.char_left_rect_extend
- buffer.char_position_from_point
- buffer.char_position_from_point_close
- buffer.char_right
- buffer.char_right_extend
- buffer.char_right_rect_extend
- buffer.check_global
- buffer.choose_caret_x
- buffer.clear
- buffer.clear_all
- buffer.clear_all_cmd_keys
- buffer.clear_document_style
- buffer.clear_registered_images
- buffer.clear_selections
- buffer.close
- buffer.colourise
- buffer.contracted_fold_next
- buffer.convert_eo_ls
- buffer.copy
- buffer.copy_allow_line
- buffer.copy_range
- buffer.copy_text
- buffer.count_characters
- buffer.cut
- buffer.del_line_left
- buffer.del_line_right
- buffer.del_word_left
- buffer.del_word_right
- buffer.del_word_right_end
- buffer.delete
- buffer.delete_back
- buffer.delete_back_not_line
- buffer.delete_range
- buffer.doc_line_from_visible
- buffer.document_end
- buffer.document_end_extend
- buffer.document_start
- buffer.document_start_extend
- buffer.edit_toggle_overtype
- buffer.empty_undo_buffer
- buffer.encoded_from_utf8
- buffer.end_undo_action
- buffer.ensure_visible
- buffer.ensure_visible_enforce_policy
- buffer.find_column
- buffer.form_feed
- buffer.get_cur_line
- buffer.get_hotspot_active_back
- buffer.get_hotspot_active_fore
- buffer.get_last_child
- buffer.get_lexer
- buffer.get_lexer_language
- buffer.get_line
- buffer.get_line_sel_end_position
- buffer.get_line_sel_start_position
- buffer.get_property
- buffer.get_property_expanded
- buffer.get_range_pointer
- buffer.get_sel_text
- buffer.get_style_name
- buffer.get_tag
- buffer.get_text
- buffer.goto_line
- buffer.goto_pos
- buffer.grab_focus
- buffer.hide_lines
- buffer.hide_selection
- buffer.home
- buffer.home_display
- buffer.home_display_extend
- buffer.home_extend
- buffer.home_rect_extend
- buffer.home_wrap
- buffer.home_wrap_extend
- buffer.indicator_all_on_for
- buffer.indicator_clear_range
- buffer.indicator_end
- buffer.indicator_fill_range
- buffer.indicator_start
- buffer.indicator_value_at
- buffer.insert_text
- buffer.line_copy
- buffer.line_cut
- buffer.line_delete
- buffer.line_down
- buffer.line_down_extend
- buffer.line_down_rect_extend
- buffer.line_duplicate
- buffer.line_end
- buffer.line_end_display
- buffer.line_end_display_extend
- buffer.line_end_extend
- buffer.line_end_rect_extend
- buffer.line_end_wrap
- buffer.line_end_wrap_extend
- buffer.line_from_position
- buffer.line_length
- buffer.line_scroll
- buffer.line_scroll_down
- buffer.line_scroll_up
- buffer.line_transpose
- buffer.line_up
- buffer.line_up_extend
- buffer.line_up_rect_extend
- buffer.lines_join
- buffer.lines_split
- buffer.lower_case
- buffer.margin_get_text
- buffer.margin_set_text
- buffer.margin_text_clear_all
- buffer.marker_add
- buffer.marker_add_set
- buffer.marker_define
- buffer.marker_define_pixmap
- buffer.marker_define_rgba_image
- buffer.marker_delete
- buffer.marker_delete_all
- buffer.marker_delete_handle
- buffer.marker_enable_highlight
- buffer.marker_get
- buffer.marker_line_from_handle
- buffer.marker_next
- buffer.marker_previous
- buffer.marker_set_alpha
- buffer.marker_set_back
- buffer.marker_set_back_selected
- buffer.marker_set_fore
- buffer.marker_symbol_defined
- buffer.move_caret_inside_view
- buffer.move_selected_lines_down
- buffer.move_selected_lines_up
- buffer.new_line
- buffer.page_down
- buffer.page_down_extend
- buffer.page_down_rect_extend
- buffer.page_up
- buffer.page_up_extend
- buffer.page_up_rect_extend
- buffer.para_down
- buffer.para_down_extend
- buffer.para_up
- buffer.para_up_extend
- buffer.paste
- buffer.point_x_from_position
- buffer.point_y_from_position
- buffer.position_after
- buffer.position_before
- buffer.position_from_line
- buffer.position_from_point
- buffer.position_from_point_close
- buffer.private_lexer_call
- buffer.redo
- buffer.register_image
- buffer.register_rgba_image
- buffer.reload
- buffer.replace_sel
- buffer.replace_target
- buffer.replace_target_re
- buffer.rotate_selection
- buffer.save
- buffer.save_as
- buffer.scroll_caret
- buffer.scroll_to_end
- buffer.scroll_to_start
- buffer.search_anchor
- buffer.search_in_target
- buffer.search_next
- buffer.search_prev
- buffer.select_all
- buffer.selection_duplicate
- buffer.set_chars_default
- buffer.set_empty_selection
- buffer.set_encoding
- buffer.set_fold_flags
- buffer.set_fold_margin_colour
- buffer.set_fold_margin_hi_colour
- buffer.set_hotspot_active_back
- buffer.set_hotspot_active_fore
- buffer.set_length_for_encode
- buffer.set_lexer
- buffer.set_lexer_language
- buffer.set_save_point
- buffer.set_sel
- buffer.set_sel_back
- buffer.set_sel_fore
- buffer.set_selection
- buffer.set_styling
- buffer.set_text
- buffer.set_visible_policy
- buffer.set_whitespace_back
- buffer.set_whitespace_fore
- buffer.set_x_caret_policy
- buffer.set_y_caret_policy
- buffer.show_lines
- buffer.start_record
- buffer.start_styling
- buffer.stop_record
- buffer.stuttered_page_down
- buffer.stuttered_page_down_extend
- buffer.stuttered_page_up
- buffer.stuttered_page_up_extend
- buffer.style_clear_all
- buffer.style_get_font
- buffer.style_reset_default
- buffer.swap_main_anchor_caret
- buffer.tab
- buffer.target_as_utf8
- buffer.target_from_selection
- buffer.text_height
- buffer.text_range
- buffer.text_width
- buffer.toggle_caret_sticky
- buffer.toggle_fold
- buffer.undo
- buffer.upper_case
- buffer.use_pop_up
- buffer.user_list_show
- buffer.vc_home
- buffer.vc_home_extend
- buffer.vc_home_rect_extend
- buffer.vc_home_wrap
- buffer.vc_home_wrap_extend
- buffer.vertical_centre_caret
- buffer.visible_from_doc_line
- buffer.word_end_position
- buffer.word_left
- buffer.word_left_end
- buffer.word_left_end_extend
- buffer.word_left_extend
- buffer.word_part_left
- buffer.word_part_left_extend
- buffer.word_part_right
- buffer.word_part_right_extend
- buffer.word_right
- buffer.word_right_end
- buffer.word_right_end_extend
- buffer.word_right_extend
- buffer.word_start_position
- buffer.wrap_count
- buffer.zoom_in
- buffer.zoom_out
- Fields
buffer
The current buffer in the current view.
It also represents the structure of any buffer table in _G._BUFFER
.
Fields
additional_caret_fore
(number)
The foreground color of additional carets in 0xBBGGRR
format.
additional_carets_blink
(bool)
Whether additional carets will blink.
additional_carets_visible
(bool)
Whether additional carets are visible.
additional_sel_alpha
(number)
The alpha of additional selections. Alpha ranges from 0
(transparent) to
255
(opaque) or 256
for no alpha.
additional_sel_back
(number)
The background color of additional selections in 0xBBGGRR
format.
buffer:set_sel_back(true, ...)
must have been called previously for this
to have an effect.
additional_sel_fore
(number)
The foreground color of additional selections in 0xBBGGRR
format.
buffer:set_sel_fore(true, ...)
must have been called previously for this
to have an effect.
additional_selection_typing
(bool)
Whether typing can be performed into multiple selections.
anchor
(number)
The position of the opposite end of the selection to the caret.
annotation_lines
(table, Read-only)
Table of the number of annotation lines for lines starting from zero.
annotation_style
(table)
Table of style numbers for annotations for lines starting at zero.
annotation_style_offset
(number)
The start of the range of style numbers used for annotations.
Annotation styles may be completely separated from standard text styles by
setting a style offset. For example, setting this to 512
would allow the
annotation styles to be numbered from 512
upto 767
so they do not
overlap styles set by lexers (or margins if margins offset is 256
). Each
style number set with buffer.annotation_style
has the offset added before
looking up the style.
annotation_visible
(number)
The visibility of annotations.
_SCINTILLA.constants.ANNOTATION_HIDDEN
(0) Annotations are not displayed._SCINTILLA.constants.ANNOTATION_STANDARD
(1) Annotations are drawn left justified with no adornment._SCINTILLA.constants.ANNOTATION_BOXED
(2) Annotations are indented to match the text and are surrounded by a box.
auto_c_auto_hide
(bool)
Whether or not autocompletion is hidden automatically when nothing matches. By default, the list is cancelled if there are no viable matches (the user has typed characters that no longer match a list entry).
auto_c_cancel_at_start
(bool)
Whether auto-completion is cancelled by backspacing to a position before
where the box was created.
If false
, the list is not cancelled until the caret moves at least one
character before the word being completed. If true
, cancel if the user
backspaces to a position before where it was created.
auto_c_case_insensitive
(int)
Auto-completion case insensitive behavior.
When autocompletion is set to ignore case (buffer.auto_c_ignore_case
), by
default it will nonetheless select the first list member that matches in a
case sensitive way to entered characters.
_SCINTILLA.constants.SC_CASEINSENSITIVEBEHAVIOR_RESPECTCASE
(0) Prefer case-sensitive matches._SCINTILLA.constants.SC_CASEINSENSITIVEBEHAVIOR_IGNORECASE
(1) No preference.
auto_c_choose_single
(bool)
Whether a single item auto-completion list automatically choose the item. The default is to display the list even if there is only a single item.
auto_c_drop_rest_of_word
(bool)
Whether or not autocompletion deletes any word characters after the
inserted text upon completion.
The default is false
.
auto_c_fill_ups
(string, Write-only)
A set of characters that when typed will cause the autocompletion to choose the selected item. By default, no fillup characters are set.
auto_c_ignore_case
(bool)
Whether case is significant when performing auto-completion searches. By default, matching of characters to list members is case sensitive.
auto_c_max_height
(number)
The maximum height, in rows, of auto-completion and user lists. The default is 5 rows.
auto_c_max_width
(number)
The maximum width, in characters, of auto-completion and user lists.
Set to 0
to autosize to fit longest item, which is the default.
auto_c_separator
(number)
The auto-completion list separator character byte. The default is the space character.
auto_c_type_separator
(number)
The auto-completion list type-separator character byte.
The default is '?'
. Autocompletion list items may display an image as
well as text. Each image is first registered with an integer type. Then
this integer is included in the text of the list separated by a ?
from
the text.
back_space_un_indents
(bool)
Whether a backspace pressed when caret is within indentation unindents.
buffered_draw
(bool)
Whether drawing is buffered. If drawing is buffered then each line of text is drawn into a bitmap buffer before drawing it to the screen to avoid flicker. The default is for drawing to be buffered. first or directly onto the screen.
call_tip_back
(number, Write-only)
The background color for the call tip in 0xBBGGRR
format.
call_tip_fore
(number, Write-only)
The foreground color for the call tip in 0xBBGGRR
format.
call_tip_fore_hlt
(number, Write-only)
The foreground color for the highlighted part of the call tip in 0xBBGGRR
format.
call_tip_position
(boolean)
The position of calltip, above or below text.
By default the calltip is displayed below the text. Setting to true
will
display it above the text.
call_tip_use_style
(number)
Enable use of _SCINTILLA.constants.STYLE_CALLTIP
and set call tip tab
size in pixels.
If the tab size is less than 1
, Tab characters are not treated specially.
caret_fore
(number)
The foreground color of the caret in 0xBBGGRR
format.
caret_line_back
(number)
The color of the background of the line containing the caret in 0xBBGGRR
format.
caret_line_back_alpha
(number)
The background alpha of the caret line.
Alpha ranges from 0
(transparent) to 255
(opaque) or 256
for no
alpha.
caret_line_visible
(bool)
Whether the background of the line containing the caret is in a different color.
caret_period
(number)
The time in milliseconds that the caret is on and off.
Setting the period to 0
stops the caret blinking. The default value is
500 milliseconds.
caret_sticky
(number)
The caret preferred x position changing when the user types.
_SCINTILLA.constants.SC_CARETSTICKY_OFF
(0) All text changes (and all caret position changes) will remember the caret’s new horizontal position when moving to different lines. This is the default._SCINTILLA.constants.SC_CARETSTICKY_ON
(1) The only thing which will cause the editor to remember the horizontal caret position is moving the caret with mouse or keyboard (left/right arrow keys, home/end keys, etc)._SCINTILLA.constants.SC_CARETSTICKY_WHITESPACE
(2) The caret acts like sticky off except under one special case; when space or tab characters are inserted. (Including pasting only space/tabs – undo, redo, etc. do not exhibit this behavior.)
caret_style
(number)
The style of the caret to be drawn.
_SCINTILLA.constants.CARETSTYLE_INVISIBLE
(0) Not draw the caret at all._SCINTILLA.constants.CARETSTYLE_LINE
(1) A line caret. This is the default value._SCINTILLA.constants.CARETSTYLE_BLOCK
(2) A block caret.
caret_width
(number)
The width of the insert mode caret in pixels.
Can be 0
, 1
, 2
or 3
pixels. The default width is 1 pixel. This
setting only affects the width of the cursor when the cursor style is set
to line caret mode, it does not affect the width for a block caret.
char_at
(table, Read-only)
Table of character bytes at positions in the document starting at zero.
code_page
(number)
The code page used to interpret the bytes of the document as characters.
The _SCINTILLA.constants.SC_CP_UTF8
value can be used to enter Unicode
mode.
column
(table, Read-only)
Table of column numbers, taking tab widths into account, for positions starting from zero.
control_char_symbol
(number)
The way control characters are displayed.
If less than 32
, keep the rounded rectangle as ASCII mnemonics.
Otherwise, use the given character byte. The default value is 0
.
current_pos
(number)
The position of the caret. When setting, the caret is not scrolled into view.
cursor
(number)
The cursor type.
_SCINTILLA.constants.SC_CURSORNORMAL
(-1) The normal cursor is displayed._SCINTILLA.constants.SC_CURSORWAIT
(4) The wait cursor is displayed when the mouse is over the view.
direct_function
(number, Read-only)
A pointer to a function that processes messages for this view.
direct_pointer
(number, Read-only)
A pointer value to use as the first argument when calling the function returned by direct_function.
dirty
(bool)
Flag indicating whether or not the buffer has been modified since it was last saved.
edge_colour
(number)
The color used in edge indication in 0xBBGGRR
format.
edge_column
(number)
The column number which text should be kept within.
edge_mode
(number)
The edge highlight mode.
_SCINTILLA.constants.EDGE_NONE
(0) Long lines are not marked. This is the default state._SCINTILLA.constants.EDGE_LINE
(1) A vertical line is drawn at the column number set bybuffer.edge_column
._SCINTILLA.constants.EDGE_BACKGROUND
(2) The background color of characters after the column limit is changed to the color set bybuffer.edge_colour
.
encoding
(string or nil)
The encoding of the file on the hard disk.
It will be nil
if the file is a binary file.
encoding_bom
(string)
The byte-order mark of the file encoding (if any).
end_at_last_line
(bool)
Whether the maximum scroll position has the last line at the bottom of the
view.
If false
, allows scrolling one page below the last line. The default
value is true
.
end_styled
(number, Read-only)
The position of the last correctly styled character.
eol_mode
(number)
The current end of line mode.
_SCINTILLA.constants.SC_EOL_CRLF
(0)CRLF
._SCINTILLA.constants.SC_EOL_CR
(1)CR
._SCINTILLA.constants.SC_EOL_LF
(2)LF
.
extra_ascent
(number)
The extra ascent, the maximum that any style extends above the baseline, added to each line.
extra_descent
(number)
The extra descent, the maximum that any style extends below the baseline, added to each line.
filename
(string)
The absolute path to the file associated with this buffer.
It is encoded in UTF-8. Use string.iconv()
for
charset conversions.
first_visible_line
(number)
The display line at the top of the display.
focus
(bool)
The internal focus flag.
fold_expanded
(bool)
Expanded state of a header line.
fold_level
(table)
Table of fold levels for lines starting from zero. Fold levels encodes an integer level along with flags indicating whether the line is a header and whether it is effectively white space.
_SCINTILLA.constants.SC_FOLDLEVELBASE
(0x400) Initial fold level._SCINTILLA.constants.SC_FOLDLEVELWHITEFLAG
(0x1000) Indicates that the line is blank._SCINTILLA.constants.SC_FOLDLEVELHEADERFLAG
(0x2000) Indicates that the line is a header (fold point).
fold_parent
(table, Read-only)
Table of parent line numbers for child lines starting from zero.
-1
means no line was found.
font_quality
(number)
(Windows only) The quality level for text.
_SCINTILLA.constants.SC_EFF_QUALITY_DEFAULt
(0)._SCINTILLA.constants.SC_EFF_QUALITY_NON_ANTIALIASED
(1)._SCINTILLA.constants.SC_EFF_QUALITY_ANTIALIASED
(2)._SCINTILLA.constants.SC_EFF_QUALITY_LCD_OPTIMIZED
(3).
gap_position
(number, Read-only)
A position which, to avoid performance costs, should not be within the
range of a call to buffer:get_range_pointer()
.
h_scroll_bar
(bool)
Whether the horizontal scroll bar is visible.
Set to false
to never see it and true
to enable it again. The default
state is to display it when needed.
highlight_guide
(number)
The highlighted indentation guide column.
Set to 0
to cancel this highlight.
hotspot_active_underline
(bool)
Whether active hotspots are underlined.
hotspot_single_line
(bool)
Whether hotspots are limited to single line so hotspots on two lines do not merge.
indent
(number)
Ihe number of spaces used for one level of indentation.
For a width of 0
, the indent size is the same as the tab size.
indentation_guides
(number)
Indentation guides appearance. Indentation guides are dotted vertical lines that appear within indentation white space every indent size columns.
_SCINTILLA.constants.SC_IV_NONE
(0) No indentation guides are shown._SCINTILLA.constants.SC_IV_REAL
(1) Indentation guides are shown inside real indentation white space._SCINTILLA.constants.SC_IV_LOOKFORWARD
(2) Indentation guides are shown beyond the actual indentation up to the level of the next non-empty line. If the previous non-empty line was a fold header then indentation guides are shown for one more level of indent than that line. This setting is good for Python._SCINTILLA.constants.SC_IV_LOOKBOTH
(3) Indentation guides are shown beyond the actual indentation up to the level of the next non-empty line or previous non-empty line whichever is the greater. This setting is good for most languages.
indic_alpha
(table)
Table of alpha transparency values ranging from 0
(transparent) to 255
(opaque) or 256
(no alpha) for indicators from 0
to 31
.
Used for drawing the fill color of the INDIC_ROUNDBOX
and
INDIC_STRAIGHTBOX
rectangle.
indic_fore
(table)
Table of foreground colors in 0xBBGGRR
format for indicators from 0
to
31
.
indic_outline_alpha
(table)
Table of alpha transparency values ranging from 0
(transparent) to 255
(opaque) or 256
(no alpha) for indicators from 0
to 31
.
Used for drawing the outline color of the INDIC_ROUNDBOX
and
INDIC_STRAIGHTBOX
rectangle.
indic_style
(table)
Table of styles for indicators from 0
to 31
.
_SCINTILLA.constants.INDIC_PLAIN
(0) Underlined with a single, straight line._SCINTILLA.constants.INDIC_SQUIGGLE
(1) A squiggly underline. Requires 3 pixels of descender space._SCINTILLA.constants.INDIC_TT
(2) A line of small T shapes._SCINTILLA.constants.INDIC_DIAGONAL
(3) Diagonal hatching._SCINTILLA.constants.INDIC_STRIKE
(4) Strike out._SCINTILLA.constants.INDIC_HIDDEN
(5) An indicator with no visual effect._SCINTILLA.constants.INDIC_BOX
(6) A rectangle around the text._SCINTILLA.constants.INDIC_ROUNDBOX
(7) A rectangle with rounded corners around the text using translucent drawing with the interior usually more transparent than the border. Usebuffer.indic_alpha
andbuffer.indic_outline_alpha
to control the alpha transparency values. The default alpha values are30
for fill color and50
for outline color._SCINTILLA.constants.INDIC_STRAIGHTBOX
(8) A rectangle around the text using translucent drawing with the interior usually more transparent than the border. You can usebuffer.indic_alpha
andbuffer.indic_outline_alpha
to control the alpha transparency values. The default alpha values are30
for fill color and50
for outline color._SCINTILLA.constants.INDIC_DASH
(9) A dashed underline._SCINTILLA.constants.INDIC_DOTS
(10) A dotted underline._SCINTILLA.constants.INDIC_SQUIGGLELOW
(11) Similar toINDIC_SQUIGGLE
but only using 2 vertical pixels so will fit under small fonts._SCINTILLA.constants.INDIC_DOTBOX
(12) A dotted rectangle around the text using translucent drawing. Translucency alternates between the alpha and outline alpha settings with the top-left pixel using the alpha setting.buffer.indic_alpha
andbuffer.indic_outline_alpha
control the alpha transparency values. The default values are30
for alpha and50
for outline alpha. To avoid excessive memory allocation the maximum width of a dotted box is 4000 pixels.- Use
_SCINTILLA.next_indic_number()
for custom indicators.
indic_under
(table)
Table of booleans for drawing under text or over (default) for indicators
from 0
to 31
.
indicator_current
(number)
The indicator in the range of 0
to 31
used for
buffer:indicator_fill_range()
and buffer:indicator_clear_range()
.
indicator_value
(number)
The indicator value used for buffer:indicator_fill_range()
.
Currently all values are drawn the same.
keys_unicode
(bool)
Interpret keyboard input as Unicode.
layout_cache
(number)
The degree of caching of layout information.
_SCINTILLA.constants.SC_CACHE_NONE
(0) No lines are cached._SCINTILLA.constants.SC_CACHE_CARET
(1) The line containing the text caret. This is the default._SCINTILLA.constants.SC_CACHE_PAGE
(2) Visible lines plus the line containing the caret._SCINTILLA.constants.SC_CACHE_DOCUMENT
(3) All lines in the document.
length
(number, Read-only)
The number of bytes in the document.
lexer
(number)
The lexing language of the document.
line_count
(number, Read-only)
The number of lines in the document. There is always at least one.
line_end_position
(table, Read-only)
Table of positions after the last visible characters on a line for lines starting from zero.
line_indent_position
(table, Read-only)
Table of positions before the first non indentation character on a line for lines starting from zero.
line_indentation
(table)
Table of line indentation amounts for lines starting from zero. The indentation is measured in character columns, which correspond to the width of space characters.
line_state
(table)
Table of extra styling information for lines starting from zero. As well as the 8 bits of lexical state stored for each character there is also an integer stored for each line. This can be used for longer lived parse states.
line_visible
(bool, Read-only)
Is a line visible?
lines_on_screen
(number, Read-only)
The number of lines completely visible.
lines_visible
(bool, Read-only)
Are all lines visible?
main_selection
(number)
The main selection. The main selection may be displayed in different colors or with a differently styled caret. Only an already existing selection can be made main.
margin_cursor_n
(table)
Table of cursors shown for margins from zero to four. A reversed arrow cursor is normally shown over all margins.
_SCINTILLA.constants.SC_CURSORARROW
Normal arrow._SCINTILLA.constants.SC_CURSORREVERSEARROW
Reversed arrow.
margin_left
(number)
The size in pixels of the left margin. The default is to one pixel.
margin_mask_n
(table)
Table of marker masks for margins from zero to four. A mask determines which markers are displayed in a margin.
margin_options
(number)
A bit mask of margin options.
_SCINTILLA.constants.SC_MARGINOPTION_NONE
(0) None (default)._SCINTILLA.constants.SC_MARGINOPTION_SUBLINESELECT
(1) Controls how wrapped lines are selected when clicking on margin in front of them. If set, only sub line of wrapped line is selected, otherwise whole wrapped line is selected.
margin_right
(number)
The size in pixels of the right margin. The default is to one pixel.
margin_sensitive_n
(table)
Table of mouse click sensitivity booleans for margins from zero to four.
A click in a sensitive margin emits a margin_click
event. By default, all
margins are insensitive.
margin_style
(table)
Table of style numbers for text margin lines starting from zero.
margin_style_offset
(number)
The start of the range of style numbers used for margin text.
Margin styles may be completely separated from standard text styles by
setting a style offset. For example, setting this to 256
would allow the
margin styles to be numbered from 256
upto 511
so they do not overlap
styles set by lexers. Each style number set with buffer.margin_style
has
the offset added before looking up the style.
margin_type_n
(table)
Table of margin types for margins from zero to four.
_SCINTILLA.constants.SC_MARGIN_SYMBOL
(0) A symbol margin._SCINTILLA.constants.SC_MARGIN_NUMBER
(1) A line number margin._SCINTILLA.constants.SC_MARGIN_BACK
(2) A symbol margin that sets its background color to match the default text background color._SCINTILLA.constants.SC_MARGIN_FORE
(3) A symbol margin that sets its background color to match the default text foreground color._SCINTILLA.constants.SC_MARGIN_TEXT
(4) A text margin._SCINTILLA.constants.SC_MARGIN_RTEXT
(5) A right justified text margin.
margin_width_n
(table)
Table of margin widths expressed in pixes for margins from zero to four.
max_line_state
(number, Read-only)
The last line number that has line state.
modify
(bool)
Whether the document is different from when it was last saved.
mouse_down_captures
(bool)
Whether the mouse is captured when its button is pressed.
mouse_dwell_time
(number)
The time the mouse must sit still to generate a mouse dwell event.
If set to _SCINTILLA.constants.SC_TIME_FOREVER
, the default, no dwell
events are generated.
multi_paste
(bool)
The effect of pasting when there are multiple selections.
_SCINTILLA.constants.SC_MULTIPASTE_ONCE
(0) Pasted text can go into just the main selection (default)._SCINTILLA.constants.SC_MULTIPASTE_EACH
(1) Pasted text can go into each selection.
multiple_selection
(bool)
Whether multiple selections can be made. When multiple selection is disabled, it is not possible to select multiple ranges by holding down the Ctrl key while dragging with the mouse.
overtype
(bool)
Overtype mode.
position_cache
(number)
The number of entries in the position cache. The position cache stores position information for short runs of text so that their layout can be determined more quickly if the run recurs.
print_colour_mode
(number)
The print color mode.
_SCINTILLA.constants.SC_PRINT_NORMAL
(0) Print using the current screen colors. This is the default._SCINTILLA.constants.SC_PRINT_INVERTLIGHT
(1) If you use a dark screen background this saves ink by inverting the light value of all colors and printing on a white background._SCINTILLA.constants.SC_PRINT_BLACKONWHITE
(2) Print all text as black on a white background._SCINTILLA.constants.SC_PRINT_COLOURONWHITE
(3) Everything prints in its own color on a white background._SCINTILLA.constants.SC_PRINT_COLOURONWHITEDEFAULTBG
(4) Everything prints in its own color on a white background except that line numbers use their own background color.
print_magnification
(number)
The print magnification added to the point size of each style for printing.
print_wrap_mode
(number)
Printing line wrap mode.
_SCINTILLA.constants.SC_WRAP_NONE
(0) Each line of text generates one line of output and the line is truncated if it is too long to fit into the print area._SCINTILLA.constants.SC_WRAP_WORD
(1) Wraps printed output so that all characters fit into the print rectangle. Tries to wrap only between words as indicated by white space or style changes although if a word is longer than a line, it will be wrapped before the line end. This is the default._SCINTILLA.constants.SC_WRAP_CHAR
(2).
property
(table, Write-only)
Table of keyword:value string pairs used by a lexer for some optional features.
property_int
(table, Read-only)
Interprets buffer.property[keyword]
as an integer if found or returns
0
.
read_only
(bool)
Read-only mode.
rectangular_selection_anchor
(number)
The position of the anchor of the rectangular selection.
rectangular_selection_anchor_virtual_space
(number)
The amount of virtual space for the anchor of the rectangular selection.
rectangular_selection_caret
(number)
The position of the caret of the rectangular selection.
rectangular_selection_caret_virtual_space
(number)
The amount of virtual space for the caret of the rectangular selection.
rectangular_selection_modifier
(number)
The modifier key used to indicate that a rectangular selection should be created when combined with a mouse drag.
_SCINTILLA.constants.SCMOD_CTRL
(2) Control key (default)._SCINTILLA.constants.SCMOD_ALT
(4) Alt key._SCINTILLA.constants.SCMOD_SUPER
(8) Left Windows key on a Windows keyboard or the Command key on a Mac.
rgba_image_height
(number)
The height for future RGBA image data.
rgba_image_width
(number)
The width for future RGBA image data.
scroll_width
(number)
The document width assumed for scrolling.
For performance, the view does not measure the display width of the
document to determine the properties of the horizontal scroll bar. Instead,
an assumed width is used. The default value is 2000
. To ensure the width
of the currently visible lines can be scrolled use
buffer.scroll_width_tracking
.
scroll_width_tracking
(bool)
Whether the maximum width line displayed is used to set scroll width.
search_flags
(number)
The search flags used by buffer:search_in_target()
.
_SCINTILLA.constants.SCFIND_WHOLEWORD
(2) A match only occurs with text that matches the case of the search string._SCINTILLA.constants.SCFIND_MATCHCASE
(4) A match only occurs if the characters before and after are not word characters._SCINTILLA.constants.SCFIND_WORDSTART
(0x00100000) A match only occurs if the character before is not a word character._SCINTILLA.constants.SCFIND_REGEXP
(0x00200000) The search string should be interpreted as a regular expression._SCINTILLA.constants.SCFIND_POSIX
(0x00400000) Treat regular expression in a more POSIX compatible manner by interpreting bare(
and)
for tagged sections rather than\(
and\)
.
sel_alpha
(number)
The alpha of the selection, between 0
(transparent) and 255
(opaque),
or 256
for no alpha.
sel_eol_filled
(bool)
The selection end of line fill. The selection can be drawn up to the right hand border by setting this property.
selection_end
(number)
The position that ends the selection - this becomes the current position. This does not make the caret visible.
selection_is_rectangle
(bool, Read-only)
Is the selection rectangular? The alternative is the more common stream selection.
selection_mode
(number)
The mode of the current selection.
_SCINTILLA.constants.SC_SEL_STREAM
(0) Stream._SCINTILLA.constants.SC_SEL_RECTANGLE
(1) Rectangle._SCINTILLA.constants.SC_SEL_LINES
(2) Lines._SCINTILLA.constants.SC_SEL_THIN
(3) Thin rectangular.
selection_n_anchor
(table)
Table of anchor positions for existing selections starting from zero, the main selection.
selection_n_anchor_virtual_space
(table)
Table of the amount of virtual space for anchors for existing selections starting from zero, the main selection.
selection_n_caret
(table)
Table of caret positions for existing selections starting from zero, the main selection.
selection_n_caret_virtual_space
(table)
Table of the amount of virtual space for carets for existing selections starting from zero, the main selection.
selection_n_end
(table)
Table of positions that end selections for existing selections starting from zero, the main selection.
selection_n_start
(table)
Table of positions that start selections for existing selections starting from zero, the main selection.
selection_start
(number)
The position that starts the selection - this becomes the anchor. This does not make the caret visible.
selections
(number, Read-only)
The number of selections currently active.
status
(number)
The error status.
_SCINTILLA.constants.SC_STATUS_OK
(0) No failures._SCINTILLA.constants.SC_STATUS_FAILURE
(1) Generic failure._SCINTILLA.constants.SC_STATUS_BADALLOC
(2) Memory is exhausted.
style_at
(table, Read-only)
Table of style bytes at positions in the document starting at zero.
style_back
(table)
Table of background colors in 0xBBGGRR
format for styles from 0
to
255
.
style_bits
(number)
The number of bits in style bytes used to hold the lexical state.
style_bits_needed
(number, Read-only)
The number of bits the current lexer needs for styling.
style_bold
(table)
Table of booleans for bold styles from 0
to 255
.
style_case
(table)
Table of cases for styles from 0
to 255
.
_SCINTILLA.constants.SC_CASE_MIXED
(0) Normal, mixed case._SCINTILLA.constants.SC_CASE_UPPER
(1) Upper case._SCINTILLA.constants.SC_CASE_LOWER
(2) Lower case.
style_changeable
(table)
Table of booleans for changeable styles from 0
to 255
.
The default setting is true
.
style_character_set
(table)
Table of character sets for styles from 0
to 255
.
style_eol_filled
(table)
Table of booleans for end of line filled styles from 0
to 255
.
style_font
(table)
Table of font faces for styles from 0
to 255
.
style_fore
(table)
Table of foreground colors in 0xBBGGRR
format for styles from 0
to
255
.
style_hot_spot
(table)
Table of boolean hotspot styles from 0
to 255
.
style_italic
(table)
Table of booleans for italic styles from 0
to 255
.
style_size
(table)
Table of font sizes for styles from 0
to 255
.
Font size is a whole number of points.
style_size_fractional
(table)
Table of sizes of characters for styles from 0
to 255
.
Size is in hundreths of a point and multiplied by 100 internally. For
example, a text size of 9.4 points is set with 940.
style_underline
(table)
Table of booleans for underlined styles from 0
to 255
.
style_visible
(table)
Table of booleans for visible styles from 0
to 255
.
style_weight
(table)
Table of character weights for styles from 0
to 255
.
The weight or boldness of a font can be set with a number between 1 and 999
with 1 being very light and 999 very heavy. While any value can be used,
fonts often only support between 2 and 4 weights with three weights being
common enough to use symbolic names:
_SCINTILLA.constants.SC_WEIGHT_NORMAL
(400) Normal._SCINTILLA.constants.SC_WEIGHT_SEMIBOLD
(600) Semi-bold._SCINTILLA.constants.SC_WEIGHT_BOLD
(700) Bold.
tab_indents
(bool)
Whether a tab pressed when caret is within indentation indents.
tab_width
(number)
The visible size of a tab as a multiple of the width of a space character. The default tab width is 8 characters.
target_end
(number)
The position that ends the target which is used for updating the document
without affecting the scroll position.
The target is also set by a successful buffer:search_in_target()
.
target_start
(number)
The position that starts the target which is used for updating the document
without affecting the scroll position.
The target is also set by a successful buffer:search_in_target()
.
text_length
(number, Read-only)
The number of characters in the document.
two_phase_draw
(bool)
Two phase drawing mode.
When true
, drawing is performed in two phases, first the background and
then the foreground. This avoids chopping off characters that overlap the
next run. The default is for drawing to be two phase.
undo_collection
(bool)
Whether to collect undo information.
When stopping collection, use buffer:empty_undo_buffer()
to avoid the
undo buffer being unsynchronized with the data in the buffer.
use_tabs
(bool)
Whether tabs will be used in indentation.
The default is true
. false
will only use space characters.
v_scroll_bar
(bool)
Whether the vertical scroll bar is visible.
Set to false
to never see it and true
to enable it again. The default
state is to display it when required.
view_eol
(bool)
Whether the end of line characters are visible. Normally, the end of line characters are hidden.
view_ws
(number)
The visibility of white space characters.
_SCINTILLA.constants.SCWS_INVISIBLE
(0) The normal display mode with white space displayed as an empty background color._SCINTILLA.constants.SCWS_VISIBLEALWAYS
(1) White space characters are drawn as dots and arrows._SCINTILLA.constants.SCWS_VISIBLEAFTERINDENT
(2) White space used for indentation is displayed normally but after the first visible character, it is shown as dots and arrows.
virtual_space_options
(number)
Virtual space options.
_SCINTILLA.constants.SCVS_NONE
(0) Disables all use of virtual space (default)._SCINTILLA.constants.SCVS_RECTANGULARSELECTION
(1) Enabled only for rectangular selections._SCINTILLA.constants.SCVS_USERACCESSIBLE
(2) Enabled.
whitespace_chars
(string, Write-only)
The set of characters making up whitespace for when moving or selecting by
word.
Use after setting buffer.word_chars
.
whitespace_size
(number)
The size of the dots used to mark space characters.
word_chars
(string)
The set of characters making up words when moving or selecting by word.
wrap_indent_mode
(number)
How wrapped sublines are placed. Default is fixed.
_SCINTILLA.constants.SC_WRAP_INDENT_FIXED
(0) Wrapped sublines aligned to left of window plus amount set bybuffer.wrap_start_indent
._SCINTILLA.constants.SC_WRAP_INDENT_SAME
(1) Wrapped sublines are aligned to first subline indent._SCINTILLA.constants.SC_WRAP_INDENT_INDENT
(2) Wrapped sublines are aligned to first subline indent plus one more level of indentation.
wrap_mode
(number)
Text word wrap mode.
_SCINTILLA.constants.SC_WRAP_NONE
(0) Disable line wrapping._SCINTILLA.constants.SC_WRAP_WORD
(1) Enable wrapping on word boundaries._SCINTILLA.constants.SC_WRAP_CHAR
(2) Enable wrapping between any characters.
wrap_start_indent
(number)
The start indent for wrapped lines.
wrap_visual_flags
(number)
The display mode of visual flags for wrapped lines.
_SCINTILLA.constants.SC_WRAPVISUALFLAG_NONE
(0) No visual flags._SCINTILLA.constants.SC_WRAPVISUALFLAG_END
(1) Visual flag at end of subline of a wrapped line._SCINTILLA.constants.SC_WRAPVISUALFLAG_START
(2) Visual flag at begin of subline of a wrapped line. Subline is indented by at least 1 to make room for the flag.
wrap_visual_flags_location
(number)
The location of visual flags for wrapped lines.
_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_DEFAULT
(0) Visual flags drawn near border._SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_END_BY_TEXT
(1) Visual flag at end of subline drawn near text._SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_START_BY_TEXT
(2) Visual flag at beginning of subline drawn near text.
x_offset
(number)
The horizontal scroll position.
A value of 0
is the normal position with the first text column visible at
the left of the view.
zoom
(number)
The number of points added to the size of all fonts. It may be positive to magnify or negative to reduce.
Functions
buffer.add_selection
(buffer, caret, anchor)
Add a selection from anchor to caret as the main selection.
Retainings all other selections as additional selections. Since there is
always at least one selection, to set a list of selections, the first
selection should be added with buffer:set_selection()
and later selections
added with this function.
Parameters:
buffer
: The global buffer.caret
: The caret.anchor
: The anchor.
buffer.add_text
(buffer, text)
Add text to the document at current position. The current position is set at the end of the inserted text, but it is not scrolled into view.
Parameters:
buffer
: The global buffer.text
: The text to add.
buffer.allocate
(buffer, bytes)
Enlarge the document to a particular size of text bytes. The document will not be made smaller than its current contents.
Parameters:
buffer
: The global buffer.bytes
:
buffer.annotation_clear_all
(buffer)
Clear the annotations from all lines.
Parameters:
buffer
: The global buffer.
buffer.annotation_get_text
(buffer, line)
Get the annotation text for a line.
Parameters:
buffer
: The global buffer.line
: The line number.
Return:
- string
buffer.annotation_set_text
(buffer, line, text)
Set the annotation text for a line.
Parameters:
buffer
: The global buffer.line
: The line number.text
: The text.
buffer.append_text
(buffer, text)
Append a string to the end of the document without changing the selection. The current selection is not changed and the new text is not scrolled into view.
Parameters:
buffer
: The global buffer.text
: The text.
buffer.auto_c_active
(buffer)
Is there an auto-completion list visible?
Parameters:
buffer
:
Return:
- bool
buffer.auto_c_cancel
(buffer)
Remove the auto-completion list from the screen.
A set of characters that will cancel autocompletion can be specified with
buffer:auto_c_stops()
.
Parameters:
buffer
: The global buffer.
buffer.auto_c_complete
(buffer)
User has selected an item so remove the list and insert the selection. This has the same effect as the tab key.
Parameters:
buffer
: The global buffer.
buffer.auto_c_get_current
(buffer)
Get currently selected item position in the auto-completion list.
Parameters:
buffer
: The global buffer.
Return:
- number
buffer.auto_c_get_current_text
(buffer)
Get currently selected item text in the auto-completion list.
Parameters:
buffer
: The global buffer.
Return:
- string
buffer.auto_c_pos_start
(buffer)
Retrieve the position of the caret when the auto-completion list was displayed.
Parameters:
buffer
: The global buffer.
Return:
- number
buffer.auto_c_select
(buffer, string)
Select the item in the auto-completion list that starts with a string.
By default, comparisons are case sensitive, but this can change with
buffer.auto_c_ignore_case
.
Parameters:
buffer
: The global buffer.string
:
buffer.auto_c_show
(buffer, len_entered, item_list)
Display an auto-completion list.
Parameters:
buffer
:len_entered
: The number of characters before the caret used to provide the context.item_list
: List of words separated by separator characters (initially spaces). The list of words should be in sorted order.
buffer.auto_c_stops
(buffer, chars)
Define a set of characters that when typed cancel the auto-completion list.
Parameters:
buffer
: The global buffer.chars
: String list of characters. This list is empty by default.
buffer.back_tab
(buffer)
Dedent the selected lines.
Parameters:
buffer
: The global buffer.
buffer.begin_undo_action
(buffer)
Start a sequence of actions that is undone and redone as a unit. May be nested.
Parameters:
buffer
: The global buffer.
buffer.brace_bad_light
(buffer, pos)
Highlight the character at a position indicating there is no matching brace.
Parameters:
buffer
: The global buffer.pos
: The position or -1 to remove the highlight.
buffer.brace_bad_light_indicator
(buffer, use_indicator, indic_num)
Use specified indicator to highlight non matching brace instead of changing its style.
Parameters:
buffer
: The global buffer.use_indicator
: Use an indicator.indic_num
: The indicator number.
buffer.brace_highlight
(buffer, pos1, pos2)
Highlight the characters at two positions.
If indent guides are enabled, the indent that corresponds with the brace can
be highlighted by locating the column with buffer.column
and highlight the
indent with buffer.highlight_guide
.
Parameters:
buffer
: The global buffer.pos1
: The first position.pos2
: The second position.
buffer.brace_highlight_indicator
(buffer, use_indicator, indic_num)
Use specified indicator to highlight matching braces instead of changing their style.
Parameters:
buffer
: The global buffer.use_indicator
: Use an indicator.indic_num
: The indicator number.
buffer.brace_match
(buffer, pos)
Find the position of a matching brace or -1
if no match.
The brace characters handled are (
, )
, [
, ]
, {
, }
, <
, and >
.
The search is forwards from an opening brace and backwards from a closing
brace. A match only occurs if the style of the matching brace is the same as
the starting brace or the matching brace is beyond the end of styling. Nested
braces are handled correctly.
Parameters:
buffer
: The global buffer.pos
: The position.
Return:
- number.
buffer.call_tip_active
(buffer)
Is there an active call tip?
Parameters:
buffer
: The global buffer.
Return:
- bool
buffer.call_tip_cancel
(buffer)
Remove the call tip from the screen. Call tips are also removed if any keyboard commands that are not compatible with editing the argument list of a function are used.
Parameters:
buffer
: The global buffer.
buffer.call_tip_pos_start
(buffer)
Retrieve the position where the caret was before displaying the call tip.
Parameters:
buffer
: The global buffer.
Return:
- number
buffer.call_tip_set_hlt
(buffer, start_pos, end_pos)
Highlights a segment of a call tip.
Parameters:
buffer
: The global buffer.start_pos
: The start position.end_pos
: The end position.
buffer.call_tip_show
(buffer, pos, text)
Show a call tip containing a definition near position pos.
The call tip text is aligned to start 1 line below this character unless up
and/or down arrows have been included in the call tip text in which case the
tip is aligned to the right-hand edge of the rightmost arrow. The assumption
is that the text starts with something like "\001 1 of 3 \002"
.
Parameters:
buffer
: The global buffer.pos
: The position.text
: The text.
buffer.can_paste
(buffer)
Will a paste succeed?
Parameters:
buffer
: The global buffer.
Return:
- bool
buffer.can_redo
(buffer)
Are there any redoable actions in the undo history?
Parameters:
buffer
: The global buffer.
Return:
- bool
buffer.can_undo
(buffer)
Are there any undoable actions in the undo history?
Parameters:
buffer
: The global buffer.
Return:
- bool
buffer.cancel
(buffer)
Cancel any modes such as call tip or auto-completion list display.
Parameters:
buffer
: The global buffer.
buffer.change_lexer_state
(buffer, start_pos, end_pos)
Indicate that the internal state of a lexer has changed over a range and therefore there may be a need to redraw.
Parameters:
buffer
: The global buffer.start_pos
: The start position.end_pos
: The end position.
buffer.char_left
(buffer)
Move caret left one character.
Parameters:
buffer
: The global buffer.
buffer.char_left_extend
(buffer)
Move caret left one character extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.char_left_rect_extend
(buffer)
Move caret left one character, extending rectangular selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.char_position_from_point
(buffer, x, y)
Find the position of a character from a point within the window.
Parameters:
buffer
: The global buffer.x
:y
:
Return:
- number
buffer.char_position_from_point_close
(buffer, x, y)
Find the position of a character from a point within the window.
Return -1
if not close to text.
Parameters:
buffer
: The global buffer.x
:y
:
Return:
- number
buffer.char_right
(buffer)
Move caret right one character.
Parameters:
buffer
: The global buffer.
buffer.char_right_extend
(buffer)
Move caret right one character extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.char_right_rect_extend
(buffer)
Move caret right one character, extending rectangular selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.check_global
(buffer)
Checks whether the given buffer is the global one.
If not, throws an error indicating so. It is necessary to call this at the
top of all buffer functions to avoid unexpected behavior since most buffer
functions operate on _G.buffer
, which is not necessarily the given one.
Parameters:
buffer
: The buffer to check.
buffer.choose_caret_x
(buffer)
Set the last x chosen value to be the caret x position. The view remembers the x value of the last position horizontally moved to explicitly by the user and this value is then used when moving vertically such as by using the up and down keys. This function sets the current x position of the caret as the remembered value.
Parameters:
buffer
: The global buffer.
buffer.clear
(buffer)
Clear the selection.
Parameters:
buffer
: The global buffer.
buffer.clear_all
(buffer)
Delete all text in the document.
Parameters:
buffer
: The global buffer.
buffer.clear_all_cmd_keys
(buffer)
Drop all key mappings.
Parameters:
buffer
: The global buffer.
buffer.clear_document_style
(buffer)
Set all style bytes to 0
, remove all folding information.
Parameters:
buffer
: The global buffer.
buffer.clear_registered_images
(buffer)
Clear all the registered XPM images.
Parameters:
buffer
: The global buffer.
buffer.clear_selections
(buffer)
Clear selections to a single empty stream selection.
Parameters:
buffer
: The global buffer.
buffer.close
(buffer)
Closes the current buffer.
Parameters:
buffer
: The global buffer. If the buffer is dirty, the user is prompted to continue. The buffer is not saved automatically. It must be done manually.
buffer.colourise
(buffer, start_pos, end_pos)
Colorise a segment of the document using the current lexing language.
Parameters:
buffer
: The global buffer.start_pos
: The start position.end_pos
: The end position or-1
to style fromstart_pos
to the end of the document.
buffer.contracted_fold_next
(buffer, line_start)
Find the next line at or after line_start that is a contracted fold header
line.
Return -1
when no more lines.
Parameters:
buffer
: The global buffer.line_start
: The start line number.
Return:
- number
buffer.convert_eo_ls
(buffer, mode)
Converts all line endings in the document to one mode.
Parameters:
buffer
: The global buffer.mode
: The line ending mode. Valid values are:_SCINTILLA.constants.SC_EOL_CRLF
(0),_SCINTILLA.constants.SC_EOL_CR (1)
, or_SCINTILLA.constants.SC_EOL_LF (2)
.
buffer.copy
(buffer)
Copy the selection to the clipboard.
Parameters:
buffer
: The buffer
buffer.copy_allow_line
(buffer)
Copy the selection, if selection empty copy the line with the caret.
Parameters:
buffer
: The global buffer.
buffer.copy_range
(buffer, start_pos, end_pos)
Copy a range of text to the clipboard. Positions are clipped into the document.
Parameters:
buffer
: The global buffer.start_pos
: The start position.end_pos
: The end position.
buffer.copy_text
(buffer, text)
Copy argument text to the clipboard.
Parameters:
buffer
: The global buffer.text
: The text.
buffer.count_characters
(buffer, start_pos, end_pos)
Count characters between two positions.
Parameters:
buffer
:start_pos
:end_pos
:
Return:
- number
buffer.cut
(buffer)
Cut the selection to the clipboard.
Parameters:
buffer
: The global buffer.
buffer.del_line_left
(buffer)
Delete back from the current position to the start of the line.
Parameters:
buffer
: The global buffer.
buffer.del_line_right
(buffer)
Delete forwards from the current position to the end of the line.
Parameters:
buffer
: The global buffer.
buffer.del_word_left
(buffer)
Delete the word to the left of the caret.
Parameters:
buffer
: The global buffer.
buffer.del_word_right
(buffer)
Delete the word to the right of the caret.
Parameters:
buffer
: The global buffer.
buffer.del_word_right_end
(buffer)
Delete the word to the right of the caret, but not the trailing non-word characters.
Parameters:
buffer
: The global buffer.
buffer.delete
(buffer)
Deletes the current buffer.
WARNING: this function should NOT be called via scripts. Use buffer:close()
instead, which prompts for confirmation if necessary. Generates a
BUFFER_DELETED
event.
Parameters:
buffer
: The global buffer.
buffer.delete_back
(buffer)
Delete the selection or if no selection, the character before the caret.
Parameters:
buffer
: The global buffer.
buffer.delete_back_not_line
(buffer)
Delete the selection or if no selection, the character before the caret. Will not delete the character before at the start of a line.
Parameters:
buffer
:
buffer.delete_range
(buffer, pos, length)
Delete a range of text in the document.
Parameters:
buffer
:pos
: The start position of the range to delete.length
: The length of the range to delete.
buffer.doc_line_from_visible
(buffer)
Find the document line of a display line taking hidden lines into account.
Parameters:
buffer
: The global buffer.
Return:
- number
buffer.document_end
(buffer)
Move caret to last position in document.
Parameters:
buffer
: The global buffer.
buffer.document_end_extend
(buffer)
Move caret to last position in document extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.document_start
(buffer)
Move caret to first position in document.
Parameters:
buffer
: The global buffer.
buffer.document_start_extend
(buffer)
Move caret to first position in document extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.edit_toggle_overtype
(buffer)
Switch from insert to overtype mode or the reverse.
Parameters:
buffer
: The global buffer.
buffer.empty_undo_buffer
(buffer)
Delete the undo history. It also sets the save point to the start of the undo buffer, so the document will appear to be unmodified.
Parameters:
buffer
: The global buffer.
buffer.encoded_from_utf8
(buffer, string)
Translates a UTF8 string into the document encoding.
Return the length of the result in bytes. On error return 0
.
Parameters:
buffer
: The global buffer.string
: The string.
Return:
- number
buffer.end_undo_action
(buffer)
End a sequence of actions that is undone and redone as a unit.
Parameters:
buffer
: The global buffer.
buffer.ensure_visible
(buffer, line)
Ensure a particular line is visible by expanding any header line hiding it.
Parameters:
buffer
: The global buffer.line
: The line number.
buffer.ensure_visible_enforce_policy
(buffer, line)
Ensure a particular line is visible by expanding any header line hiding it. Use the currently set visibility policy to determine which range to display.
Parameters:
buffer
: The global buffer.line
: The line number.
buffer.find_column
(buffer, line, column)
Find the position of a column on a line taking into account tabs and multi-byte characters. If beyond end of line, return line end position.
Parameters:
buffer
: The global buffer.line
: The line number.column
: The column number.
buffer.form_feed
(buffer)
Insert a Form Feed character.
Parameters:
buffer
: The global buffer.
buffer.get_cur_line
(buffer)
Retrieve the text of the line containing the caret. Also returns the index of the caret on the line.
Parameters:
buffer
: The global buffer.
Return:
- string, number
buffer.get_hotspot_active_back
(buffer)
Get the back color for active hotspots in 0xBBGGRR format.
Parameters:
buffer
: The global buffer.
Return:
- number
buffer.get_hotspot_active_fore
(buffer)
Get the fore color for active hotspots.
Parameters:
buffer
: The global buffer.
Return:
- number
buffer.get_last_child
(buffer, header_line, level)
Find the last child line of a header line.
Parameters:
buffer
: The global buffer.header_line
: The line number of a header line.level
: The level or-1
for the level of header_line.
buffer.get_lexer
(buffer, current)
Replacement for buffer.get_lexer_language(buffer)
.
Parameters:
buffer
: The global buffer.current
: Whether to get the lexer at the current caret position in multi-language lexers. The default isfalse
and returns the parent lexer.
buffer.get_lexer_language
(buffer)
Retrieve the name of the lexer.
Parameters:
buffer
: The global buffer.
buffer.get_line
(buffer, line)
Retrieve the contents of a line. Also returns the length of the line.
Parameters:
buffer
: The global buffer.line
: The line number.
Return:
- string, number
buffer.get_line_sel_end_position
(buffer, line)
Retrieve the position of the end of the selection at the given line (-1
if
no selection on this line).
Parameters:
buffer
: The global buffer.line
: The line number.
buffer.get_line_sel_start_position
(buffer, line)
Retrieve the position of the start of the selection at the given line (-1
if no selection on this line).
Parameters:
buffer
: The global buffer.line
: The line number.
buffer.get_property
(buffer, key)
Retrieve a property
value previously set with buffer.property
.
Parameters:
buffer
: The global buffer.key
: Keyword.
Return:
- string
buffer.get_property_expanded
(buffer, key)
Retrieve a property
value previously set with buffer.property
, with $()
variable replacement on returned buffer.
Parameters:
buffer
: The global buffer.key
: Keyword.
Return:
- string
buffer.get_range_pointer
(buffer, position, range_length)
Return a read-only pointer to a range of characters in the document.
May move the gap so that the range is contiguous, but will only move up to
range_length bytes.
The gap is not moved unless it is within the requested range so this call can
be faster than SCI_GETCHARACTERPOINTER
. This can be used by application
code that is able to act on blocks of text or ranges of lines.
Parameters:
buffer
:position
:range_length
:
buffer.get_sel_text
(buffer)
Retrieve the selected text. Also returns the length of the text.
Parameters:
buffer
: The global buffer.
Return:
- string, number
buffer.get_style_name
(buffer, style_num)
Returns the name of the style associated with a style number.
Parameters:
buffer
: The global buffer.style_num
: A style number from0
to255
.
See also:
buffer.get_tag
(buffer, tag_num)
Retrieve the value of a tag from a regular expression search.
Parameters:
buffer
: The global buffer.tag_num
: The tag number.
Return:
- string
buffer.get_text
(buffer)
Retrieve all the text in the document. Also returns number of characters retrieved.
Parameters:
buffer
: The global buffer.
buffer.goto_line
(buffer, line)
Set caret to start of a line and ensure it is visible.
Parameters:
buffer
: The global buffer.line
: The line number.
buffer.goto_pos
(buffer, pos)
Set caret to a position and ensure it is visible. The anchor position is set the same as the current position.
Parameters:
buffer
: The global buffer.pos
: The position.
buffer.grab_focus
(buffer)
Set the focus to this view.
Parameters:
buffer
: The global buffer.
buffer.hide_lines
(buffer, start_line, end_line)
Make a range of lines invisible.
This has no effect on fold levels or fold flags. start_line
can not be
hidden.
Parameters:
buffer
: The global buffer.start_line
: The start line.end_line
: The end line.
buffer.hide_selection
(buffer, normal)
Draw the selection in normal style or with selection highlighted.
Parameters:
buffer
: The global buffer.normal
: Draw normal selection.
buffer.home
(buffer)
Move caret to first position on line.
Parameters:
buffer
: The global buffer.
buffer.home_display
(buffer)
Move caret to first position on display line.
Parameters:
buffer
: The global buffer.
buffer.home_display_extend
(buffer)
Move caret to first position on display line extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.home_extend
(buffer)
Move caret to first position on line extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.home_rect_extend
(buffer)
Move caret to first position on line, extending rectangular selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.home_wrap
(buffer)
Move caret to the start of the display line when word-wrap is enabled. If already there, go to the start of the document line.
Parameters:
buffer
: The global buffer.
buffer.home_wrap_extend
(buffer)
Like buffer:home_wrap()
but extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.indicator_all_on_for
(buffer, pos)
Retrieve a bitmap value representing which indicators are non-zero at a position. Bit 0 is set if indicator 0 is present, bit 1 for indicator 1 and so on.
Parameters:
buffer
: The global buffer.pos
: The position.
Return:
- number
buffer.indicator_clear_range
(buffer, pos, clear_length)
Turn a indicator off over a range.
Parameters:
buffer
: The global buffer.pos
: The start position.clear_length
: The length.
buffer.indicator_end
(buffer, indicator, pos)
Find the position where a particular indicator ends.
Parameters:
buffer
: The global buffer.indicator
: An indicator number in the range of0
to31
.pos
: The position of the indicator.
buffer.indicator_fill_range
(buffer, pos, fill_length)
Turn a indicator on over a range. This function fills with the current indicator value.
Parameters:
buffer
: The global buffer.pos
: the start position.fill_length
: The length.
buffer.indicator_start
(buffer, indicator, pos)
Find the position where a particular indicator starts.
Parameters:
buffer
: The global buffer.indicator
: An indicator number in the range of0
to31
.pos
: The position of the indicator.
buffer.indicator_value_at
(buffer, indicator, pos)
Retrieve the value of a particular indicator at a position. Currently all values are drawn the same.
Parameters:
buffer
: The global buffer.indicator
: The indicator number in the range of0
to31
.pos
: The position.
Return:
- number
buffer.insert_text
(buffer, pos, text)
Insert string at a position. If the current position is after the insertion point then it is moved along with its surrounding text but no scrolling is performed.
Parameters:
buffer
: The global buffer.pos
: The position to insert text at or-1
for the current position.text
: The text to insert.
buffer.line_copy
(buffer)
Copy the line containing the caret.
Parameters:
buffer
: The global buffer.
buffer.line_cut
(buffer)
Cut the line containing the caret.
Parameters:
buffer
: The global buffer.
buffer.line_delete
(buffer)
Delete the line containing the caret.
Parameters:
buffer
: The global buffer.
buffer.line_down
(buffer)
Move caret down one line.
Parameters:
buffer
: The global buffer.
buffer.line_down_extend
(buffer)
Move caret down one line extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.line_down_rect_extend
(buffer)
Move caret down one line, extending rectangular selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.line_duplicate
(buffer)
Duplicate the current line.
Parameters:
buffer
: The global buffer.
buffer.line_end
(buffer)
Move caret to last position on line.
Parameters:
buffer
: The global buffer.
buffer.line_end_display
(buffer)
Move caret to last position on display line.
Parameters:
buffer
: The global buffer.
buffer.line_end_display_extend
(buffer)
Move caret to last position on display line extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.line_end_extend
(buffer)
Move caret to last position on line extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.line_end_rect_extend
(buffer)
Move caret to last position on line, extending rectangular selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.line_end_wrap
(buffer)
Move caret to the end of the display line when word-wrap is enabled. If already there, go to the end of the document line.
Parameters:
buffer
: The global buffer.
buffer.line_end_wrap_extend
(buffer)
Like buffer:line_end_wrap()
but extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.line_from_position
(buffer, pos)
Retrieve the line containing a position.
Parameters:
buffer
: The global buffer.pos
: The position.
Return:
- number
buffer.line_length
(buffer, line)
Returns how many characters are on a line, including end of line characters.
To get the length of the line not including any end of line characters, use
buffer.line_end_position[line] - buffer:position_from_line(line)
.
Parameters:
buffer
: The global buffer.line
: The line number.
Return:
- number
buffer.line_scroll
(buffer, columns, lines)
Scroll horizontally and vertically.
Parameters:
buffer
: The global buffer.columns
: The number of columns to scroll horizontally.lines
: The number of lines to scroll vertically.
buffer.line_scroll_down
(buffer)
Scroll the document down, keeping the caret visible.
Parameters:
buffer
: The global buffer.
buffer.line_scroll_up
(buffer)
Scroll the document up, keeping the caret visible.
Parameters:
buffer
: The global buffer.
buffer.line_transpose
(buffer)
Switch the current line with the previous.
Parameters:
buffer
: The global buffer.
buffer.line_up
(buffer)
Move caret up one line.
Parameters:
buffer
: The global buffer.
buffer.line_up_extend
(buffer)
Move caret up one line extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.line_up_rect_extend
(buffer)
Move caret up one line, extending rectangular selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.lines_join
(buffer)
Join the lines in the target. Where this would lead to no space between words, an extra space is inserted.
Parameters:
buffer
: The global buffer.
buffer.lines_split
(buffer, pixel_width)
Split the lines in the target into lines that are less wide than
pixel_width
where possible.
Parameters:
buffer
: The global buffer.pixel_width
: The pixel width. When0
, the width of the view is used.
buffer.lower_case
(buffer)
Transform the selection to lower case.
Parameters:
buffer
: The global buffer.
buffer.margin_get_text
(buffer, line)
Get the text in the text margin for a line.
Parameters:
buffer
: The global buffer.line
: The line number.
Return:
- string
buffer.margin_set_text
(buffer, line, text)
Set the text in the text margin for a line.
Parameters:
buffer
: The global buffer.line
: The line number.text
: The text.
buffer.margin_text_clear_all
(buffer)
Clear the margin text on all lines.
Parameters:
buffer
: The global buffer.
buffer.marker_add
(buffer, line, marker_num)
Add a marker to a line, returning an ID which can be used to find or delete
the marker.
Returns -1
if this fails (illegal line number, out of memory).
Parameters:
buffer
: The global buffer.line
: The line number.marker_num
: A marker number in the range of0
to31
.
Return:
- number
buffer.marker_add_set
(buffer, line, marker_mask)
Add a set of markers to a line.
Parameters:
buffer
: The global buffer.line
: The line number.marker_mask
: A mask of markers to set. Set bit 0 to set marker 0, bit 1 for marker 1 and so on.
buffer.marker_define
(buffer, marker_num, marker_symbol)
Set the symbol used for a particular marker number.
Parameters:
buffer
: The global buffer.marker_num
: A marker number in the range of0
to31
.marker_symbol
: A marker symbol:_SCINTILLA.constants.SC_MARK_*
.
See also:
buffer.marker_define_pixmap
(buffer, marker_num, pixmap)
Define a marker from a pixmap.
Parameters:
buffer
: The global buffer.marker_num
: A marker number in the range of0
to31
.pixmap
:NULL
-terminated pixmap data.
buffer.marker_define_rgba_image
(buffer, marker_num, pixels)
Define a marker from RGBA data.
It has the width and height from buffer.rgba_image_width
and
buffer.rgba_image_height
.
Parameters:
buffer
: The global buffer.marker_num
: A marker number in the range of0
to31
.pixels
: A sequence of 4 byte pixel values starting with the pixels for the top line, with the leftmost pixel first, then continuing with the pixels for subsequent lines. There is no gap between lines for alignment reasons. Each pixel consists of, in order, a red byte, a green byte, a blue byte and an alpha byte. The colour bytes are not premultiplied by the alpha value. That is, a fully red pixel that is 25% opaque will be[FF, 00, 00, 3F]
.
buffer.marker_delete
(buffer, line, marker_num)
Delete a marker from a line.
Parameters:
buffer
: The global buffer.line
: The line number.marker_num
: A marker number in the range of0
to31
or-1
to delete all markers from the line.
buffer.marker_delete_all
(buffer, marker_num)
Delete all markers with a particular number from all lines.
Parameters:
buffer
: The global buffer.marker_num
: A marker number in the range of0
to31
or-1
to delete all markers from the line.
buffer.marker_delete_handle
(buffer, handle)
Delete a marker.
Parameters:
buffer
: The global buffer.handle
: The identifier of a marker returned bybuffer:marker_add()
.
buffer.marker_enable_highlight
(buffer, enabled)
Enable/disable highlight for current folding block (smallest one that contains the caret)
Parameters:
buffer
: The global buffer.enabled
:
buffer.marker_get
(buffer, line)
Get a bit mask of all the markers set on a line. Bit 0 is set if marker 0 is present, bit 1 for marker 1 and so on.
Parameters:
buffer
: The global buffer.line
: The line number.
Return:
- number.
buffer.marker_line_from_handle
(buffer, handle)
Retrieve the line number at which a particular marker is located.
Returns -1
if it not found.
Parameters:
buffer
: The global buffer.handle
: The identifier of a marker returned bybuffer:marker_add()
.
Return:
- number
buffer.marker_next
(buffer, start_line, marker_mask)
Find the next line at or after start_line that includes a marker in mask.
Return -1
when no more lines.
Parameters:
buffer
: The global buffer.start_line
: The start line.marker_mask
: A mask of markers to find. Set bit 0 to find marker 0, bit 1 for marker 1 and so on.
Return:
- number
buffer.marker_previous
(buffer, start_line, marker_mask)
Find the previous line before start_line
that includes a marker in mask.
Parameters:
buffer
: The global buffer.start_line
: The start line.marker_mask
: A mask of markers to find. Set bit 0 to find marker 0, bit 1 for marker 1 and so on.
Return:
- number
buffer.marker_set_alpha
(buffer, marker_num, alpha)
Set the alpha used for a marker that is drawn in the text area, not the margin.
Parameters:
buffer
: The global buffer.marker_num
: A marker number in the range of0
to31
.alpha
: An alpha value between0
(transparent) and255
(opaque), or256
for no alpha.
buffer.marker_set_back
(buffer, marker_num, color)
Set the background color used for a particular marker number.
Parameters:
buffer
: The global buffer.marker_num
: A marker number in the range of0
to31
.color
: A color in0xBBGGRR
format.
buffer.marker_set_back_selected
(buffer, marker_num, color)
Set the background color used for a particular marker number when its folding block is selected.
Parameters:
buffer
: The global buffer.marker_num
: A marker number in the range of0
to31
.color
: A color in0xBBGGRR
format. The default color is#FF0000
.
buffer.marker_set_fore
(buffer, marker_num, color)
Set the foreground color used for a particular marker number.
Parameters:
buffer
: The global buffer.marker_num
: A marker number in the range of0
to31
.color
: A color in0xBBGGRR
format.
buffer.marker_symbol_defined
(buffer, marker_num)
Return the symbol defined for marker_num with buffer:marker_define()
.
Parameters:
buffer
: The global buffer.marker_num
: A marker number in the range of0
to31
.
Return:
- number
buffer.move_caret_inside_view
(buffer)
Move the caret inside current view if it is not there already. Any selection is lost.
Parameters:
buffer
: The global buffer.
buffer.move_selected_lines_down
(buffer)
Move the selected lines down one line, shifting the line below before the selection. The selection will be automatically extended to the beginning of the selection’s first line and the end of the seletion’s last line. If nothing was selected, the line the cursor is currently at will be selected.
Parameters:
buffer
: The global buffer.
buffer.move_selected_lines_up
(buffer)
Move the selected lines up one line, shifting the line above after the selection. The selection will be automatically extended to the beginning of the selection’s first line and the end of the seletion’s last line. If nothing was selected, the line the cursor is currently at will be selected.
Parameters:
buffer
: The global buffer.
buffer.new_line
(buffer)
Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
Parameters:
buffer
: The global buffer.
buffer.page_down
(buffer)
Move caret one page down.
Parameters:
buffer
: The global buffer.
buffer.page_down_extend
(buffer)
Move caret one page down extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.page_down_rect_extend
(buffer)
Move caret one page down, extending rectangular selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.page_up
(buffer)
Move caret one page up.
Parameters:
buffer
: The global buffer.
buffer.page_up_extend
(buffer)
Move caret one page up extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.page_up_rect_extend
(buffer)
Move caret one page up, extending rectangular selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.para_down
(buffer)
Move caret one paragraph down (delimited by empty lines).
Parameters:
buffer
: The global buffer.
buffer.para_down_extend
(buffer)
Move caret one paragraph down (delimited by empty lines) extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.para_up
(buffer)
Move caret one paragraph up (delimited by empty lines).
Parameters:
buffer
: The global buffer.
buffer.para_up_extend
(buffer)
Move caret one paragraph up (delimited by empty lines) extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.paste
(buffer)
Paste the contents of the clipboard into the document replacing the selection.
Parameters:
buffer
: The global buffer.
buffer.point_x_from_position
(buffer, pos)
Retrieve the x value of the point in the window where a position is displayed.
Parameters:
buffer
: The global buffer.pos
: The position.
Return:
- number
buffer.point_y_from_position
(buffer, pos)
Retrieve the y value of the point in the window where a position is displayed.
Parameters:
buffer
: The global buffer.pos
: The position.
Return:
- number
buffer.position_after
(buffer, pos)
Given a valid document position, return the next position taking code page into account. Maximum value returned is the last position in the document.
Parameters:
buffer
: The global buffer.pos
: The position.
buffer.position_before
(buffer, pos)
Given a valid document position, return the previous position taking code
page into account. Returns 0
if passed 0
.
Parameters:
buffer
: The global buffer.pos
: The position.
Return:
- number
buffer.position_from_line
(buffer, line)
Retrieve the position at the start of a line.
If line is greater than the lines in the document, returns -1
.
Parameters:
buffer
: The global buffer.line
: The line.
Return:
- number
buffer.position_from_point
(buffer, x, y)
Find the position from a point within the window.
Parameters:
buffer
: The global buffer.x
:y
:
Return:
- number
buffer.position_from_point_close
(buffer, x, y)
Returns the position from a point within the window, but return -1
if not
close to text.
Parameters:
buffer
: The global buffer.x
:y
:
Return:
- number
buffer.private_lexer_call
(buffer, operation, data)
For private communication between an application and a known lexer.
Parameters:
buffer
: The global buffer.operation
: An operation number.data
: Number data.
buffer.redo
(buffer)
Redoes the next action on the undo history.
Parameters:
buffer
: The global buffer.
buffer.register_image
(buffer, type, xpm_data)
Register an XPM image for use in autocompletion lists.
Parameters:
buffer
: The global buffer.type
: Integer type to register the image with.xpm_data
: XPM data as is described forbuffer:marker_define_pixmap()
.
buffer.register_rgba_image
(buffer, type, pixels)
Register an RGBA image for use in autocompletion lists.
It has the width and height from buffer.rgba_image_width
and
buffer.rgba_image_height
.
Parameters:
buffer
: The global buffer.type
: Integer type to register the image with.pixels
: RGBA data as is described forbuffer:marker_define_rgba_image()
.
buffer.reload
(buffer)
Reloads the file in a given buffer.
Parameters:
buffer
: The global buffer.
buffer.replace_sel
(buffer, text)
Replace the selected text with the argument text. The caret is positioned after the inserted text and the caret is scrolled into view.
Parameters:
buffer
: The global buffer.text
: The text.
buffer.replace_target
(buffer, text)
Replace the target text with the argument text. After replacement, the target range refers to the replacement text. Returns the length of the replacement text.
Parameters:
buffer
: The global buffer.text
: The text (can contain NULs).
Return:
- number
buffer.replace_target_re
(buffer, text)
Replace the target text with the argument text after \d
processing.
Looks for \d
where d
is between 1
and 9
and replaces these with the
strings matched in the last search operation which were surrounded by \(
and \)
. Returns the length of the replacement text including any change
caused by processing the \d
patterns.
Parameters:
buffer
: The global buffer.text
: The text (can contain NULs).
Return:
- number
buffer.rotate_selection
(buffer)
Set the main selection to the next selection.
Parameters:
buffer
: The global buffer.
buffer.save
(buffer)
Saves the current buffer to a file.
Parameters:
buffer
: The global buffer.
buffer.save_as
(buffer, utf8_filename)
Saves the current buffer to a file different than its filename property.
Parameters:
buffer
: The global buffer.utf8_filename
: The new filepath to save the buffer to. Must be UTF-8 encoded.
buffer.scroll_caret
(buffer)
Ensure the caret is visible.
Parameters:
buffer
: The global buffer.
buffer.scroll_to_end
(buffer)
Scroll to end of document.
Parameters:
buffer
: The global buffer.
buffer.scroll_to_start
(buffer)
Scroll to start of document.
Parameters:
buffer
: The global buffer.
buffer.search_anchor
(buffer)
Sets the current caret position to be the search anchor.
Always call this before calling either of buffer:search_next()
or
buffer:search_prev()
.
Parameters:
buffer
: The global buffer.
buffer.search_in_target
(buffer, text)
Search for a counted string in the target and set the target to the found
range.
Returns length of range or -1
for failure in which case target is not
moved.
Parameters:
buffer
: The global buffer.text
: The text (can contain NULs).
Return:
- number
buffer.search_next
(buffer, flags, text)
Find some text starting at the search anchor.
The return value is -1
if nothing is found, otherwise the return value is
the start position of the matching text. The selection is updated to show the
matched text, but is not scrolled into view.
Parameters:
buffer
: The global buffer.flags
: Search flags. Seebuffer.search_flags
.text
: The text.
Return:
- number
buffer.search_prev
(buffer, flags, text)
Find some text starting at the search anchor and moving backwards.
The return value is -1
if nothing is found, otherwise the return value is
the start position of the matching text. The selection is updated to show the
matched text, but is not scrolled into view.
Parameters:
buffer
: The global buffer.flags
: Search flags. Seebuffer.search_flags
.text
: The text.
Return:
- number
buffer.select_all
(buffer)
Select all the text in the document. The current position is not scrolled into view.
Parameters:
buffer
: The global buffer.
buffer.selection_duplicate
(buffer)
Duplicate the selection. If selection empty duplicate the line containing the caret.
Parameters:
buffer
: The global buffer.
buffer.set_chars_default
(buffer)
Reset the set of characters for whitespace and word characters to the
defaults.
This sets whitespace to space, tab and other characters with codes less than
0x20
, with word characters set to alphanumeric and '_'
.
Parameters:
buffer
: The global buffer.
buffer.set_empty_selection
(buffer, pos)
Set caret to a position, while removing any existing selection. The caret is not scrolled into view.
Parameters:
buffer
: The bufferpos
: The position to move to.
buffer.set_encoding
(buffer, encoding)
Sets the encoding for the buffer, converting its contents in the process.
Parameters:
buffer
: The global buffer.encoding
: The encoding to set. Valid encodings are ones that GTK’sg_convert()
function accepts (typically GNU iconv’s encodings).
Usage:
buffer.set_encoding(buffer, 'ASCII')
buffer.set_fold_flags
(buffer, flags)
Set some style options for folding.
Parameters:
buffer
: The global buffer.flags
: Mask of fold flags. Flags available are_SCINTILLA.constants.SC_FOLDFLAG_LINEBEFORE_EXPANDED
(2): Draw above if expanded;_SCINTILLA.constants.SC_FOLDFLAG_LINEBEFORE_CONTRACTED
(4): Draw above if not expanded;_SCINTILLA.constants.SC_FOLDFLAG_LINEAFTER_EXPANDED
(8): Draw below if expanded;_SCINTILLA.constants.SC_FOLDFLAG_LINEAFTER_CONTRACTED
(16): Draw below if not expanded
buffer.set_fold_margin_colour
(buffer, use_setting, color)
Set the colors used as a chequerboard pattern in the fold margin.
Parameters:
buffer
: The global buffer.use_setting
: Enable color change.color
: A color in0xBBGGRR
format.
buffer.set_fold_margin_hi_colour
(buffer, use_setting, color)
Set the colors used as a checkerboard pattern in the fold margin.
Parameters:
buffer
: The global buffer.use_setting
: Enable color change.color
: A color in0xBBGGRR
format.
buffer.set_hotspot_active_back
(buffer, use_setting, color)
Set a back color for active hotspots.
Parameters:
buffer
: The global buffer.use_setting
: Enable the color change.color
: A color in0xBBGGRR
format.
buffer.set_hotspot_active_fore
(buffer, use_setting, color)
Set a fore color for active hotspots.
Parameters:
buffer
: The global buffer.use_setting
: Enable the color change.color
: A color in0xBBGGRR
format.
buffer.set_length_for_encode
(buffer, bytes)
Set the length of the utf8 argument for calling buffer:encoded_from_utf8()
.
Parameters:
buffer
: The global buffer.bytes
: Bytes or-1
for measuring to first NUL.
buffer.set_lexer
(buffer, lang)
Replacement for buffer.set_lexer_language(buffer)
.
Sets a buffer._lexer
field so it can be restored without querying the
mime-types tables. Also if the user manually sets the lexer, it should be
restored.
Loads the language-specific module if it exists.
This function is added by _M.textadept.mime_types
.
Parameters:
buffer
: The global buffer.lang
: The string language to set.
Usage:
buffer.set_lexer(buffer, 'language_name')
buffer.set_lexer_language
(buffer, language_name)
Set the lexing language of the document based on string name.
Parameters:
buffer
: The global buffer.language_name
: The language name.
buffer.set_save_point
(buffer)
Remember the current position in the undo history as the position at which the document was saved.
Parameters:
buffer
: The global buffer.
buffer.set_sel
(buffer, start_pos, end_pos)
Select a range of text. The caret is scrolled into view after this operation.
Parameters:
buffer
: The global buffer.start_pos
: Start position. If negative, it means the end of the document.end_pos
: End position. If negative, it means remove any selection (i.e. set theanchor
to the same position ascurrent_pos
).
buffer.set_sel_back
(buffer, use_setting, color)
Set the background color of the main and additional selections and whether to use this setting.
Parameters:
buffer
: The global buffer.use_setting
: Enable color change.color
: A color in0xBBGGRR
format.
buffer.set_sel_fore
(buffer, use_setting, color)
Set the foreground color of the main and additional selections and whether to use this setting.
Parameters:
buffer
: The global buffer.use_setting
: Enable color change.color
: A color in0xBBGGRR
format.
buffer.set_selection
(buffer, caret, anchor)
Set a simple selection from anchor to caret.
Parameters:
buffer
: The global buffer.caret
: The caret.anchor
: The anchor.
buffer.set_styling
(buffer, length, style)
Change style from current styling position for length characters to a style and move the current styling position to after this newly styled segment.
Parameters:
buffer
: The global buffer.length
: The length to style.style
: The style number to set.
buffer.set_text
(buffer, text)
Replace the contents of the document with the argument text.
Parameters:
buffer
: The global buffer.text
: The text.
buffer.set_visible_policy
(buffer, visible_policy, visible_slop)
Set the way the display area is determined when a particular line is to be
moved to by buffer:goto_line()
, etc.
It is similar in operation to buffer:set_y_caret_policy()
.
Parameters:
buffer
: The global buffer.visible_policy
: A combination of_SCINTILLA.constants.VISIBLE_SLOP
, (0x01) and_SCINTILLA.constants.VISIBLE_STRICT
(0x04).visible_slop
: The slop value.
buffer.set_whitespace_back
(buffer, use_setting, color)
Set the background color of all whitespace and whether to use this setting.
Parameters:
buffer
: The global buffer.use_setting
: Enable color change.color
: A color in0xBBGGRR
format.
buffer.set_whitespace_fore
(buffer, use_setting, color)
Set the foreground color of all whitespace and whether to use this setting.
Parameters:
buffer
: The global buffer.use_setting
: Enable color change.color
: A color in0xBBGGRR
format.
buffer.set_x_caret_policy
(buffer, caret_policy, caret_slop)
Set the way the caret is kept visible when going sideway. The exclusion zone is given in pixels.
Parameters:
buffer
: The global buffer.caret_policy
: A combination of_SCINTILLA.constants.CARET_SLOP
(0x01),_SCINTILLA.constants.CARET_STRICT
(0x04),_SCINTILLA.constants.CARET_JUMPS
(0x10), and_SCINTILLA.constants.CARET_EVEN
(0x08).caret_slop
: A slop value.
buffer.set_y_caret_policy
(buffer, caret_policy, caret_slop)
Set the way the line the caret is on is kept visible.
Parameters:
buffer
: The global buffer.caret_policy
: A combination of_SCINTILLA.constants.CARET_SLOP
(0x01),_SCINTILLA.constants.CARET_STRICT
(0x04),_SCINTILLA.constants.CARET_JUMPS
(0x10), and_SCINTILLA.constants.CARET_EVEN
(0x08).caret_slop
: A slop value.
buffer.show_lines
(buffer, start_line, end_line)
Make a range of lines visible.
This has no effect on fold levels or fold flags. start_line
can not be
hidden.
Parameters:
buffer
: The global buffer.start_line
: The start line.end_line
: The end line.
buffer.start_record
(buffer)
Start notifying the container of all key presses and commands.
Parameters:
buffer
: The global buffer.
buffer.start_styling
(buffer, position, mask)
Set the current styling position to pos and the styling mask to mask. The styling mask can be used to protect some bits in each styling byte from modification.
Parameters:
buffer
: The global buffer.position
: The styling position.mask
: The bit mask of the style bytes that can be set.
buffer.stop_record
(buffer)
Stop notifying the container of all key presses and commands.
Parameters:
buffer
: The global buffer.
buffer.stuttered_page_down
(buffer)
Move caret to bottom of page, or one page down if already at bottom of page.
Parameters:
buffer
: The global buffer.
buffer.stuttered_page_down_extend
(buffer)
Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.stuttered_page_up
(buffer)
Move caret to top of page, or one page up if already at top of page.
Parameters:
buffer
: The global buffer.
buffer.stuttered_page_up_extend
(buffer)
Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.style_clear_all
(buffer)
Clear all the styles and make equivalent to the global default style.
Parameters:
buffer
: The global buffer.
buffer.style_get_font
(buffer, style_num)
Returns the font name of a given style.
Parameters:
buffer
: The global buffer.style_num
: The style number.
Return:
- string
buffer.style_reset_default
(buffer)
Reset the default style to its state at startup.
Parameters:
buffer
: The global buffer.
buffer.swap_main_anchor_caret
(buffer)
Swap that caret and anchor of the main selection.
Parameters:
buffer
: The global buffer.
buffer.tab
(buffer)
If selection is empty or all on one line replace the selection with a tab character, or if more than one line selected, indent the lines.
Parameters:
buffer
: The global buffer.
buffer.target_as_utf8
(buffer)
Returns the target converted to UTF8.
Parameters:
buffer
: The global buffer.
buffer.target_from_selection
(buffer)
Make the target range start and end be the same as the selection range start and end.
Parameters:
buffer
: The global buffer.
buffer.text_height
(buffer, line)
Retrieve the height of a particular line of text in pixels.
Parameters:
buffer
: The global buffer.line
: The line number.
Return:
- number
buffer.text_range
(buffer, start_pos, end_pos)
Gets a range of text from the current buffer.
Parameters:
buffer
: The global buffer.start_pos
: The beginning position of the range of text to get.end_pos
: The end position of the range of text to get.
buffer.text_width
(buffer, style_num, text)
Measure the pixel width of some text in a particular style. Does not handle tab or control characters.
Parameters:
buffer
: The global buffer.style_num
: The style number between0
and255
.text
: The text.
Return:
- number
buffer.toggle_caret_sticky
(buffer)
Switch between sticky and non-sticky: meant to be bound to a key.
See buffer.caret_sticky
.
Parameters:
buffer
: The global buffer.
buffer.toggle_fold
(buffer, line)
Switch a header line between expanded and contracted.
Parameters:
buffer
: The global buffer.line
: The line number.
buffer.undo
(buffer)
Undo one action in the undo history.
Parameters:
buffer
: The global buffer.
buffer.upper_case
(buffer)
Transform the selection to upper case.
Parameters:
buffer
: The global buffer.
buffer.use_pop_up
(buffer, allow_popup)
Sets whether a pop up menu is displayed automatically when the user presses the wrong mouse button.
Parameters:
buffer
: The global buffer.allow_popup
: Allow popup menu.
buffer.user_list_show
(buffer, list_type, item_list)
Display a list of strings and send notification when user chooses one.
Parameters:
buffer
: The global buffer.list_type
: A list identifier number greater than zero.item_list
: List of words separated by separator characters (initially spaces).
See also:
buffer.vc_home
(buffer)
Move caret to before first visible character on line. If already there move to first character on line.
Parameters:
buffer
: The global buffer.
buffer.vc_home_extend
(buffer)
Like buffer:vc_home()
but extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.vc_home_rect_extend
(buffer)
Move caret to before first visible character on line. If already there move to first character on line. In either case, extend rectangular selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.vc_home_wrap
(buffer)
Move caret to before first visible character on display line when word-wrap is enabled. If already there, go to first character on display line.
Parameters:
buffer
: The global buffer.
buffer.vc_home_wrap_extend
(buffer)
Like buffer:vc_home_wrap()
but extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.vertical_centre_caret
(buffer)
Center current line in window.
Parameters:
buffer
: The global buffer.
buffer.visible_from_doc_line
(buffer, line)
Find the display line of a document line taking hidden lines into account.
If there is folding and line is outside the range of lines in the document,
the return value is -1
.
Parameters:
buffer
: The global buffer.line
: The line number.
Return:
- number
buffer.word_end_position
(buffer, pos, only_word_chars)
Get position of end of word.
Parameters:
buffer
: The global buffer.pos
: The position.only_word_chars
: Iftrue
, stops searching at the first non-word character in the search direction. Otherwise, the first character in the search direction sets the type of the search as word or non-word and the search stops at the first non-matching character. Searches are also terminated by the start or end of the document.
buffer.word_left
(buffer)
Move caret left one word.
Parameters:
buffer
: The global buffer.
buffer.word_left_end
(buffer)
Move caret left one word, position cursor at end of word.
Parameters:
buffer
: The global buffer.
buffer.word_left_end_extend
(buffer)
Move caret left one word, position cursor at end of word, extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.word_left_extend
(buffer)
Move caret left one word extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.word_part_left
(buffer)
Move to the previous change in capitalisation or underscores.
Parameters:
buffer
: The global buffer.
buffer.word_part_left_extend
(buffer)
Move to the previous change in capitalisation or underscores extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.word_part_right
(buffer)
Move to the next change in capitalisation or underscores.
Parameters:
buffer
: The global buffer.
buffer.word_part_right_extend
(buffer)
Move to the next change in capitalisation or underscores extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.word_right
(buffer)
Move caret right one word.
Parameters:
buffer
: The global buffer.
buffer.word_right_end
(buffer)
Move caret right one word, position cursor at end of word.
Parameters:
buffer
: The global buffer.
buffer.word_right_end_extend
(buffer)
Move caret right one word, position cursor at end of word, extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.word_right_extend
(buffer)
Move caret right one word extending selection to new caret position.
Parameters:
buffer
: The global buffer.
buffer.word_start_position
(buffer, pos, only_word_chars)
Get position of start of word.
Parameters:
buffer
: The global buffer.pos
: The position.only_word_chars
: Iftrue
, stops searching at the first non-word character in the search direction. Otherwise, the first character in the search direction sets the type of the search as word or non-word and the search stops at the first non-matching character. Searches are also terminated by the start or end of the document.
buffer.wrap_count
(buffer, line)
Returns the number of display lines needed to wrap a document line.
Parameters:
buffer
: The global buffer.line
: The line number.
Return:
- number
buffer.zoom_in
(buffer)
Magnify the displayed text by increasing the sizes by 1 point if the current zoom factor is less than 20 points.
Parameters:
buffer
: The global buffer.
buffer.zoom_out
(buffer)
Make the displayed text smaller by decreasing the sizes by 1 point if the current zoom factor is greater than -10 points.
Parameters:
buffer
: The global buffer.