:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/TextEdit.xml. .. _class_TextEdit: TextEdit ======== **Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` Multiline text editing control. Description ----------- TextEdit is meant for editing large, multiline text. It also has facilities for editing code, such as syntax highlighting support and multiple levels of undo/redo. \ **Note:** When holding down ``Alt``, the vertical scroll wheel will scroll 5 times as fast as it would normally do. This also works in the Godot script editor. Properties ---------- +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`bookmark_gutter` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`breakpoint_gutter` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`caret_blink` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`caret_blink_speed` | ``0.65`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`caret_block_mode` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`caret_moving_by_right_click` | ``true`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`context_menu_enabled` | ``true`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`deselect_on_focus_loss_enabled` | ``true`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`drag_and_drop_selection_enabled` | ``true`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`draw_spaces` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`draw_tabs` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`FocusMode` | focus_mode | ``2`` (overrides :ref:`Control`) | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`fold_gutter` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`hiding_enabled` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`highlight_all_occurrences` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`highlight_current_line` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`middle_mouse_paste_enabled` | ``true`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`minimap_draw` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`minimap_width` | ``80`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`CursorShape` | mouse_default_cursor_shape | ``1`` (overrides :ref:`Control`) | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`override_selected_font_color` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`readonly` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`scroll_horizontal` | ``0`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`scroll_vertical` | ``0.0`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`selecting_enabled` | ``true`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`shortcut_keys_enabled` | ``true`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`show_line_numbers` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`smooth_scrolling` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`syntax_highlighting` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`text` | ``""`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`v_scroll_speed` | ``80.0`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`virtual_keyboard_enabled` | ``true`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`wrap_enabled` | ``false`` | +----------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ Methods ------- +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_color_region` **(** :ref:`String` begin_key, :ref:`String` end_key, :ref:`Color` color, :ref:`bool` line_only=false **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_keyword_color` **(** :ref:`String` keyword, :ref:`Color` color **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`can_fold` **(** :ref:`int` line **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`center_viewport_to_cursor` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_colors` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_undo_history` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`copy` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`cursor_get_column` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`cursor_get_line` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cursor_set_column` **(** :ref:`int` column, :ref:`bool` adjust_viewport=true **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cursor_set_line` **(** :ref:`int` line, :ref:`bool` adjust_viewport=true, :ref:`bool` can_be_hidden=true, :ref:`int` wrap_index=0 **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cut` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`deselect` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fold_all_lines` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fold_line` **(** :ref:`int` line **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`get_breakpoints` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_keyword_color` **(** :ref:`String` keyword **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_line` **(** :ref:`int` line **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_line_column_at_pos` **(** :ref:`Vector2` position **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_line_count` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_line_height` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_line_width` **(** :ref:`int` line, :ref:`int` wrap_index=-1 **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_line_wrap_count` **(** :ref:`int` line **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_line_wrapped_text` **(** :ref:`int` line **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PopupMenu` | :ref:`get_menu` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_pos_at_line_column` **(** :ref:`int` line, :ref:`int` column **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`get_rect_at_line_column` **(** :ref:`int` line, :ref:`int` column **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selection_from_column` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selection_from_line` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_selection_text` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selection_to_column` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selection_to_line` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_total_gutter_width` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_total_visible_rows` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_visible_rows` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_word_under_cursor` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_keyword_color` **(** :ref:`String` keyword **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_redo` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_undo` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`insert_text_at_cursor` **(** :ref:`String` text **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_folded` **(** :ref:`int` line **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_line_hidden` **(** :ref:`int` line **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_line_set_as_bookmark` **(** :ref:`int` line **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_line_set_as_breakpoint` **(** :ref:`int` line **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_line_set_as_safe` **(** :ref:`int` line **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_line_wrapped` **(** :ref:`int` line **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_mouse_over_selection` **(** :ref:`bool` edges **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_selection_active` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`menu_option` **(** :ref:`int` option **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`paste` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`redo` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_breakpoints` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolIntArray` | :ref:`search` **(** :ref:`String` key, :ref:`int` flags, :ref:`int` from_line, :ref:`int` from_column **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`select` **(** :ref:`int` from_line, :ref:`int` from_column, :ref:`int` to_line, :ref:`int` to_column **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`select_all` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_line` **(** :ref:`int` line, :ref:`String` new_text **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_line_as_bookmark` **(** :ref:`int` line, :ref:`bool` bookmark **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_line_as_breakpoint` **(** :ref:`int` line, :ref:`bool` breakpoint **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_line_as_hidden` **(** :ref:`int` line, :ref:`bool` enable **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_line_as_safe` **(** :ref:`int` line, :ref:`bool` safe **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`toggle_fold_line` **(** :ref:`int` line **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`undo` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`unfold_line` **(** :ref:`int` line **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`unhide_all_lines` **(** **)** | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Theme Properties ---------------- +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`background_color` | ``Color( 0, 0, 0, 0 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`bookmark_color` | ``Color( 0.08, 0.49, 0.98, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`brace_mismatch_color` | ``Color( 1, 0.2, 0.2, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`breakpoint_color` | ``Color( 0.8, 0.8, 0.4, 0.2 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`caret_background_color` | ``Color( 0, 0, 0, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`caret_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`code_folding_color` | ``Color( 0.8, 0.8, 0.8, 0.8 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`completion_background_color` | ``Color( 0.17, 0.16, 0.2, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`completion_existing_color` | ``Color( 0.87, 0.87, 0.87, 0.13 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`completion_font_color` | ``Color( 0.67, 0.67, 0.67, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`completion_scroll_color` | ``Color( 1, 1, 1, 0.29 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`completion_selected_color` | ``Color( 0.26, 0.26, 0.27, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`current_line_color` | ``Color( 0.25, 0.25, 0.26, 0.8 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`executing_line_color` | ``Color( 0.2, 0.8, 0.2, 0.4 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`font_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`font_color_readonly` | ``Color( 0.88, 0.88, 0.88, 0.5 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`font_color_selected` | ``Color( 0, 0, 0, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`function_color` | ``Color( 0.4, 0.64, 0.81, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`line_number_color` | ``Color( 0.67, 0.67, 0.67, 0.4 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`mark_color` | ``Color( 1, 0.4, 0.4, 0.4 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`member_variable_color` | ``Color( 0.9, 0.31, 0.35, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`number_color` | ``Color( 0.92, 0.58, 0.2, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`safe_line_number_color` | ``Color( 0.67, 0.78, 0.67, 0.6 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`selection_color` | ``Color( 0.49, 0.49, 0.49, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`symbol_color` | ``Color( 0.94, 0.94, 0.94, 1 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`word_highlighted_color` | ``Color( 0.8, 0.9, 0.9, 0.15 )`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`int` | :ref:`completion_lines` | ``7`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`int` | :ref:`completion_max_width` | ``50`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`int` | :ref:`completion_scroll_width` | ``6`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`int` | :ref:`line_spacing` | ``4`` | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Font` | :ref:`font` | | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Texture` | :ref:`fold` | | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Texture` | :ref:`folded` | | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Texture` | :ref:`space` | | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Texture` | :ref:`tab` | | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`completion` | | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`focus` | | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`normal` | | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`read_only` | | +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ Signals ------- .. _class_TextEdit_signal_breakpoint_toggled: - **breakpoint_toggled** **(** :ref:`int` row **)** Emitted when a breakpoint is placed via the breakpoint gutter. ---- .. _class_TextEdit_signal_cursor_changed: - **cursor_changed** **(** **)** Emitted when the cursor changes. ---- .. _class_TextEdit_signal_info_clicked: - **info_clicked** **(** :ref:`int` row, :ref:`String` info **)** Emitted when the info icon is clicked. ---- .. _class_TextEdit_signal_request_completion: - **request_completion** **(** **)** ---- .. _class_TextEdit_signal_symbol_lookup: - **symbol_lookup** **(** :ref:`String` symbol, :ref:`int` row, :ref:`int` column **)** ---- .. _class_TextEdit_signal_text_changed: - **text_changed** **(** **)** Emitted when the text changes. Enumerations ------------ .. _enum_TextEdit_SearchFlags: .. _class_TextEdit_constant_SEARCH_MATCH_CASE: .. _class_TextEdit_constant_SEARCH_WHOLE_WORDS: .. _class_TextEdit_constant_SEARCH_BACKWARDS: enum **SearchFlags**: - **SEARCH_MATCH_CASE** = **1** --- Match case when searching. - **SEARCH_WHOLE_WORDS** = **2** --- Match whole words when searching. - **SEARCH_BACKWARDS** = **4** --- Search from end to beginning. ---- .. _enum_TextEdit_SearchResult: .. _class_TextEdit_constant_SEARCH_RESULT_COLUMN: .. _class_TextEdit_constant_SEARCH_RESULT_LINE: enum **SearchResult**: - **SEARCH_RESULT_COLUMN** = **0** --- Used to access the result column from :ref:`search`. - **SEARCH_RESULT_LINE** = **1** --- Used to access the result line from :ref:`search`. ---- .. _enum_TextEdit_MenuItems: .. _class_TextEdit_constant_MENU_CUT: .. _class_TextEdit_constant_MENU_COPY: .. _class_TextEdit_constant_MENU_PASTE: .. _class_TextEdit_constant_MENU_CLEAR: .. _class_TextEdit_constant_MENU_SELECT_ALL: .. _class_TextEdit_constant_MENU_UNDO: .. _class_TextEdit_constant_MENU_REDO: .. _class_TextEdit_constant_MENU_MAX: enum **MenuItems**: - **MENU_CUT** = **0** --- Cuts (copies and clears) the selected text. - **MENU_COPY** = **1** --- Copies the selected text. - **MENU_PASTE** = **2** --- Pastes the clipboard text over the selected text (or at the cursor's position). - **MENU_CLEAR** = **3** --- Erases the whole ``TextEdit`` text. - **MENU_SELECT_ALL** = **4** --- Selects the whole ``TextEdit`` text. - **MENU_UNDO** = **5** --- Undoes the previous action. - **MENU_REDO** = **6** --- Redoes the previous action. - **MENU_MAX** = **7** --- Represents the size of the :ref:`MenuItems` enum. Property Descriptions --------------------- .. _class_TextEdit_property_bookmark_gutter: - :ref:`bool` **bookmark_gutter** +-----------+------------------------------------+ | *Default* | ``false`` | +-----------+------------------------------------+ | *Setter* | set_bookmark_gutter_enabled(value) | +-----------+------------------------------------+ | *Getter* | is_bookmark_gutter_enabled() | +-----------+------------------------------------+ If ``true``, the bookmark gutter is visible. ---- .. _class_TextEdit_property_breakpoint_gutter: - :ref:`bool` **breakpoint_gutter** +-----------+--------------------------------------+ | *Default* | ``false`` | +-----------+--------------------------------------+ | *Setter* | set_breakpoint_gutter_enabled(value) | +-----------+--------------------------------------+ | *Getter* | is_breakpoint_gutter_enabled() | +-----------+--------------------------------------+ If ``true``, the breakpoint gutter is visible. ---- .. _class_TextEdit_property_caret_blink: - :ref:`bool` **caret_blink** +-----------+---------------------------------+ | *Default* | ``false`` | +-----------+---------------------------------+ | *Setter* | cursor_set_blink_enabled(value) | +-----------+---------------------------------+ | *Getter* | cursor_get_blink_enabled() | +-----------+---------------------------------+ If ``true``, the caret (visual cursor) blinks. ---- .. _class_TextEdit_property_caret_blink_speed: - :ref:`float` **caret_blink_speed** +-----------+-------------------------------+ | *Default* | ``0.65`` | +-----------+-------------------------------+ | *Setter* | cursor_set_blink_speed(value) | +-----------+-------------------------------+ | *Getter* | cursor_get_blink_speed() | +-----------+-------------------------------+ Duration (in seconds) of a caret's blinking cycle. ---- .. _class_TextEdit_property_caret_block_mode: - :ref:`bool` **caret_block_mode** +-----------+------------------------------+ | *Default* | ``false`` | +-----------+------------------------------+ | *Setter* | cursor_set_block_mode(value) | +-----------+------------------------------+ | *Getter* | cursor_is_block_mode() | +-----------+------------------------------+ If ``true``, the caret displays as a rectangle. If ``false``, the caret displays as a bar. ---- .. _class_TextEdit_property_caret_moving_by_right_click: - :ref:`bool` **caret_moving_by_right_click** +-----------+------------------------------------+ | *Default* | ``true`` | +-----------+------------------------------------+ | *Setter* | set_right_click_moves_caret(value) | +-----------+------------------------------------+ | *Getter* | is_right_click_moving_caret() | +-----------+------------------------------------+ If ``true``, a right-click moves the cursor at the mouse position before displaying the context menu. If ``false``, the context menu disregards mouse location. ---- .. _class_TextEdit_property_context_menu_enabled: - :ref:`bool` **context_menu_enabled** +-----------+---------------------------------+ | *Default* | ``true`` | +-----------+---------------------------------+ | *Setter* | set_context_menu_enabled(value) | +-----------+---------------------------------+ | *Getter* | is_context_menu_enabled() | +-----------+---------------------------------+ If ``true``, a right-click displays the context menu. ---- .. _class_TextEdit_property_deselect_on_focus_loss_enabled: - :ref:`bool` **deselect_on_focus_loss_enabled** +-----------+-------------------------------------------+ | *Default* | ``true`` | +-----------+-------------------------------------------+ | *Setter* | set_deselect_on_focus_loss_enabled(value) | +-----------+-------------------------------------------+ | *Getter* | is_deselect_on_focus_loss_enabled() | +-----------+-------------------------------------------+ If ``true``, the selected text will be deselected when focus is lost. ---- .. _class_TextEdit_property_drag_and_drop_selection_enabled: - :ref:`bool` **drag_and_drop_selection_enabled** +-----------+--------------------------------------------+ | *Default* | ``true`` | +-----------+--------------------------------------------+ | *Setter* | set_drag_and_drop_selection_enabled(value) | +-----------+--------------------------------------------+ | *Getter* | is_drag_and_drop_selection_enabled() | +-----------+--------------------------------------------+ If ``true``, allow drag and drop of selected text. ---- .. _class_TextEdit_property_draw_spaces: - :ref:`bool` **draw_spaces** +-----------+------------------------+ | *Default* | ``false`` | +-----------+------------------------+ | *Setter* | set_draw_spaces(value) | +-----------+------------------------+ | *Getter* | is_drawing_spaces() | +-----------+------------------------+ If ``true``, the "space" character will have a visible representation. ---- .. _class_TextEdit_property_draw_tabs: - :ref:`bool` **draw_tabs** +-----------+----------------------+ | *Default* | ``false`` | +-----------+----------------------+ | *Setter* | set_draw_tabs(value) | +-----------+----------------------+ | *Getter* | is_drawing_tabs() | +-----------+----------------------+ If ``true``, the "tab" character will have a visible representation. ---- .. _class_TextEdit_property_fold_gutter: - :ref:`bool` **fold_gutter** +-----------+-----------------------------+ | *Default* | ``false`` | +-----------+-----------------------------+ | *Setter* | set_draw_fold_gutter(value) | +-----------+-----------------------------+ | *Getter* | is_drawing_fold_gutter() | +-----------+-----------------------------+ If ``true``, the fold gutter is visible. This enables folding groups of indented lines. ---- .. _class_TextEdit_property_hiding_enabled: - :ref:`bool` **hiding_enabled** +-----------+---------------------------+ | *Default* | ``false`` | +-----------+---------------------------+ | *Setter* | set_hiding_enabled(value) | +-----------+---------------------------+ | *Getter* | is_hiding_enabled() | +-----------+---------------------------+ If ``true``, all lines that have been set to hidden by :ref:`set_line_as_hidden`, will not be visible. ---- .. _class_TextEdit_property_highlight_all_occurrences: - :ref:`bool` **highlight_all_occurrences** +-----------+----------------------------------------+ | *Default* | ``false`` | +-----------+----------------------------------------+ | *Setter* | set_highlight_all_occurrences(value) | +-----------+----------------------------------------+ | *Getter* | is_highlight_all_occurrences_enabled() | +-----------+----------------------------------------+ If ``true``, all occurrences of the selected text will be highlighted. ---- .. _class_TextEdit_property_highlight_current_line: - :ref:`bool` **highlight_current_line** +-----------+-------------------------------------+ | *Default* | ``false`` | +-----------+-------------------------------------+ | *Setter* | set_highlight_current_line(value) | +-----------+-------------------------------------+ | *Getter* | is_highlight_current_line_enabled() | +-----------+-------------------------------------+ If ``true``, the line containing the cursor is highlighted. ---- .. _class_TextEdit_property_middle_mouse_paste_enabled: - :ref:`bool` **middle_mouse_paste_enabled** +-----------+---------------------------------------+ | *Default* | ``true`` | +-----------+---------------------------------------+ | *Setter* | set_middle_mouse_paste_enabled(value) | +-----------+---------------------------------------+ | *Getter* | is_middle_mouse_paste_enabled() | +-----------+---------------------------------------+ If ``false``, using middle mouse button to paste clipboard will be disabled. \ **Note:** This method is only implemented on Linux. ---- .. _class_TextEdit_property_minimap_draw: - :ref:`bool` **minimap_draw** +-----------+----------------------+ | *Default* | ``false`` | +-----------+----------------------+ | *Setter* | draw_minimap(value) | +-----------+----------------------+ | *Getter* | is_drawing_minimap() | +-----------+----------------------+ If ``true``, a minimap is shown, providing an outline of your source code. ---- .. _class_TextEdit_property_minimap_width: - :ref:`int` **minimap_width** +-----------+--------------------------+ | *Default* | ``80`` | +-----------+--------------------------+ | *Setter* | set_minimap_width(value) | +-----------+--------------------------+ | *Getter* | get_minimap_width() | +-----------+--------------------------+ The width, in pixels, of the minimap. ---- .. _class_TextEdit_property_override_selected_font_color: - :ref:`bool` **override_selected_font_color** +-----------+-----------------------------------------+ | *Default* | ``false`` | +-----------+-----------------------------------------+ | *Setter* | set_override_selected_font_color(value) | +-----------+-----------------------------------------+ | *Getter* | is_overriding_selected_font_color() | +-----------+-----------------------------------------+ If ``true``, custom ``font_color_selected`` will be used for selected text. ---- .. _class_TextEdit_property_readonly: - :ref:`bool` **readonly** +-----------+---------------------+ | *Default* | ``false`` | +-----------+---------------------+ | *Setter* | set_readonly(value) | +-----------+---------------------+ | *Getter* | is_readonly() | +-----------+---------------------+ If ``true``, read-only mode is enabled. Existing text cannot be modified and new text cannot be added. ---- .. _class_TextEdit_property_scroll_horizontal: - :ref:`int` **scroll_horizontal** +-----------+---------------------+ | *Default* | ``0`` | +-----------+---------------------+ | *Setter* | set_h_scroll(value) | +-----------+---------------------+ | *Getter* | get_h_scroll() | +-----------+---------------------+ If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels. ---- .. _class_TextEdit_property_scroll_vertical: - :ref:`float` **scroll_vertical** +-----------+---------------------+ | *Default* | ``0.0`` | +-----------+---------------------+ | *Setter* | set_v_scroll(value) | +-----------+---------------------+ | *Getter* | get_v_scroll() | +-----------+---------------------+ If there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line. ---- .. _class_TextEdit_property_selecting_enabled: - :ref:`bool` **selecting_enabled** +-----------+------------------------------+ | *Default* | ``true`` | +-----------+------------------------------+ | *Setter* | set_selecting_enabled(value) | +-----------+------------------------------+ | *Getter* | is_selecting_enabled() | +-----------+------------------------------+ If ``true``, text can be selected. If ``false``, text can not be selected by the user or by the :ref:`select` or :ref:`select_all` methods. ---- .. _class_TextEdit_property_shortcut_keys_enabled: - :ref:`bool` **shortcut_keys_enabled** +-----------+----------------------------------+ | *Default* | ``true`` | +-----------+----------------------------------+ | *Setter* | set_shortcut_keys_enabled(value) | +-----------+----------------------------------+ | *Getter* | is_shortcut_keys_enabled() | +-----------+----------------------------------+ If ``true``, shortcut keys for context menu items are enabled, even if the context menu is disabled. ---- .. _class_TextEdit_property_show_line_numbers: - :ref:`bool` **show_line_numbers** +-----------+--------------------------------+ | *Default* | ``false`` | +-----------+--------------------------------+ | *Setter* | set_show_line_numbers(value) | +-----------+--------------------------------+ | *Getter* | is_show_line_numbers_enabled() | +-----------+--------------------------------+ If ``true``, line numbers are displayed to the left of the text. ---- .. _class_TextEdit_property_smooth_scrolling: - :ref:`bool` **smooth_scrolling** +-----------+---------------------------------+ | *Default* | ``false`` | +-----------+---------------------------------+ | *Setter* | set_smooth_scroll_enable(value) | +-----------+---------------------------------+ | *Getter* | is_smooth_scroll_enabled() | +-----------+---------------------------------+ If ``true``, sets the ``step`` of the scrollbars to ``0.25`` which results in smoother scrolling. ---- .. _class_TextEdit_property_syntax_highlighting: - :ref:`bool` **syntax_highlighting** +-----------+------------------------------+ | *Default* | ``false`` | +-----------+------------------------------+ | *Setter* | set_syntax_coloring(value) | +-----------+------------------------------+ | *Getter* | is_syntax_coloring_enabled() | +-----------+------------------------------+ If ``true``, any custom color properties that have been set for this ``TextEdit`` will be visible. ---- .. _class_TextEdit_property_text: - :ref:`String` **text** +-----------+-----------------+ | *Default* | ``""`` | +-----------+-----------------+ | *Setter* | set_text(value) | +-----------+-----------------+ | *Getter* | get_text() | +-----------+-----------------+ String value of the ``TextEdit``. ---- .. _class_TextEdit_property_v_scroll_speed: - :ref:`float` **v_scroll_speed** +-----------+---------------------------+ | *Default* | ``80.0`` | +-----------+---------------------------+ | *Setter* | set_v_scroll_speed(value) | +-----------+---------------------------+ | *Getter* | get_v_scroll_speed() | +-----------+---------------------------+ Vertical scroll sensitivity. ---- .. _class_TextEdit_property_virtual_keyboard_enabled: - :ref:`bool` **virtual_keyboard_enabled** +-----------+-------------------------------------+ | *Default* | ``true`` | +-----------+-------------------------------------+ | *Setter* | set_virtual_keyboard_enabled(value) | +-----------+-------------------------------------+ | *Getter* | is_virtual_keyboard_enabled() | +-----------+-------------------------------------+ If ``true``, the native virtual keyboard is shown when focused on platforms that support it. ---- .. _class_TextEdit_property_wrap_enabled: - :ref:`bool` **wrap_enabled** +-----------+-------------------------+ | *Default* | ``false`` | +-----------+-------------------------+ | *Setter* | set_wrap_enabled(value) | +-----------+-------------------------+ | *Getter* | is_wrap_enabled() | +-----------+-------------------------+ If ``true``, enables text wrapping when it goes beyond the edge of what is visible. Method Descriptions ------------------- .. _class_TextEdit_method_add_color_region: - void **add_color_region** **(** :ref:`String` begin_key, :ref:`String` end_key, :ref:`Color` color, :ref:`bool` line_only=false **)** Adds color region (given the delimiters) and its colors. ---- .. _class_TextEdit_method_add_keyword_color: - void **add_keyword_color** **(** :ref:`String` keyword, :ref:`Color` color **)** Adds a ``keyword`` and its :ref:`Color`. ---- .. _class_TextEdit_method_can_fold: - :ref:`bool` **can_fold** **(** :ref:`int` line **)** |const| Returns if the given line is foldable, that is, it has indented lines right below it. ---- .. _class_TextEdit_method_center_viewport_to_cursor: - void **center_viewport_to_cursor** **(** **)** Centers the viewport on the line the editing cursor is at. This also resets the :ref:`scroll_horizontal` value to ``0``. ---- .. _class_TextEdit_method_clear_colors: - void **clear_colors** **(** **)** Clears all custom syntax coloring information previously added with :ref:`add_color_region` or :ref:`add_keyword_color`. ---- .. _class_TextEdit_method_clear_undo_history: - void **clear_undo_history** **(** **)** Clears the undo history. ---- .. _class_TextEdit_method_copy: - void **copy** **(** **)** Copy's the current text selection. ---- .. _class_TextEdit_method_cursor_get_column: - :ref:`int` **cursor_get_column** **(** **)** |const| Returns the column the editing cursor is at. ---- .. _class_TextEdit_method_cursor_get_line: - :ref:`int` **cursor_get_line** **(** **)** |const| Returns the line the editing cursor is at. ---- .. _class_TextEdit_method_cursor_set_column: - void **cursor_set_column** **(** :ref:`int` column, :ref:`bool` adjust_viewport=true **)** Moves the cursor at the specified ``column`` index. If ``adjust_viewport`` is set to ``true``, the viewport will center at the cursor position after the move occurs. ---- .. _class_TextEdit_method_cursor_set_line: - void **cursor_set_line** **(** :ref:`int` line, :ref:`bool` adjust_viewport=true, :ref:`bool` can_be_hidden=true, :ref:`int` wrap_index=0 **)** Moves the cursor at the specified ``line`` index. If ``adjust_viewport`` is set to ``true``, the viewport will center at the cursor position after the move occurs. If ``can_be_hidden`` is set to ``true``, the specified ``line`` can be hidden using :ref:`set_line_as_hidden`. ---- .. _class_TextEdit_method_cut: - void **cut** **(** **)** Cut's the current selection. ---- .. _class_TextEdit_method_deselect: - void **deselect** **(** **)** Deselects the current selection. ---- .. _class_TextEdit_method_fold_all_lines: - void **fold_all_lines** **(** **)** Folds all lines that are possible to be folded (see :ref:`can_fold`). ---- .. _class_TextEdit_method_fold_line: - void **fold_line** **(** :ref:`int` line **)** Folds the given line, if possible (see :ref:`can_fold`). ---- .. _class_TextEdit_method_get_breakpoints: - :ref:`Array` **get_breakpoints** **(** **)** |const| Returns an array containing the line number of each breakpoint. ---- .. _class_TextEdit_method_get_keyword_color: - :ref:`Color` **get_keyword_color** **(** :ref:`String` keyword **)** |const| Returns the :ref:`Color` of the specified ``keyword``. ---- .. _class_TextEdit_method_get_line: - :ref:`String` **get_line** **(** :ref:`int` line **)** |const| Returns the text of a specific line. ---- .. _class_TextEdit_method_get_line_column_at_pos: - :ref:`Vector2` **get_line_column_at_pos** **(** :ref:`Vector2` position **)** |const| Returns the line and column at the given position. In the returned vector, ``x`` is the column, ``y`` is the line. ---- .. _class_TextEdit_method_get_line_count: - :ref:`int` **get_line_count** **(** **)** |const| Returns the amount of total lines in the text. ---- .. _class_TextEdit_method_get_line_height: - :ref:`int` **get_line_height** **(** **)** |const| Returns the height of a largest line. ---- .. _class_TextEdit_method_get_line_width: - :ref:`int` **get_line_width** **(** :ref:`int` line, :ref:`int` wrap_index=-1 **)** |const| Returns the width in pixels of the ``wrap_index`` on ``line``. ---- .. _class_TextEdit_method_get_line_wrap_count: - :ref:`int` **get_line_wrap_count** **(** :ref:`int` line **)** |const| Returns the number of times the given line is wrapped. ---- .. _class_TextEdit_method_get_line_wrapped_text: - :ref:`PoolStringArray` **get_line_wrapped_text** **(** :ref:`int` line **)** |const| Returns an array of :ref:`String`\ s representing each wrapped index. ---- .. _class_TextEdit_method_get_menu: - :ref:`PopupMenu` **get_menu** **(** **)** |const| Returns the :ref:`PopupMenu` of this ``TextEdit``. By default, this menu is displayed when right-clicking on the ``TextEdit``. \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible` property. ---- .. _class_TextEdit_method_get_pos_at_line_column: - :ref:`Vector2` **get_pos_at_line_column** **(** :ref:`int` line, :ref:`int` column **)** |const| Returns the local position for the given ``line`` and ``column``. If ``x`` or ``y`` of the returned vector equal ``-1``, the position is outside of the viewable area of the control. \ **Note:** The Y position corresponds to the bottom side of the line. Use :ref:`get_rect_at_line_column` to get the top side position. ---- .. _class_TextEdit_method_get_rect_at_line_column: - :ref:`Rect2` **get_rect_at_line_column** **(** :ref:`int` line, :ref:`int` column **)** |const| Returns the local position and size for the grapheme at the given ``line`` and ``column``. If ``x`` or ``y`` position of the returned rect equal ``-1``, the position is outside of the viewable area of the control. \ **Note:** The Y position of the returned rect corresponds to the top side of the line, unlike :ref:`get_pos_at_line_column` which returns the bottom side. ---- .. _class_TextEdit_method_get_selection_from_column: - :ref:`int` **get_selection_from_column** **(** **)** |const| Returns the selection begin column. ---- .. _class_TextEdit_method_get_selection_from_line: - :ref:`int` **get_selection_from_line** **(** **)** |const| Returns the selection begin line. ---- .. _class_TextEdit_method_get_selection_text: - :ref:`String` **get_selection_text** **(** **)** |const| Returns the text inside the selection. ---- .. _class_TextEdit_method_get_selection_to_column: - :ref:`int` **get_selection_to_column** **(** **)** |const| Returns the selection end column. ---- .. _class_TextEdit_method_get_selection_to_line: - :ref:`int` **get_selection_to_line** **(** **)** |const| Returns the selection end line. ---- .. _class_TextEdit_method_get_total_gutter_width: - :ref:`int` **get_total_gutter_width** **(** **)** |const| Returns the total width of all gutters and internal padding. ---- .. _class_TextEdit_method_get_total_visible_rows: - :ref:`int` **get_total_visible_rows** **(** **)** |const| Returns the total amount of lines that could be drawn. ---- .. _class_TextEdit_method_get_visible_rows: - :ref:`int` **get_visible_rows** **(** **)** |const| Returns the number of visible lines, including wrapped text. ---- .. _class_TextEdit_method_get_word_under_cursor: - :ref:`String` **get_word_under_cursor** **(** **)** |const| Returns a :ref:`String` text with the word under the caret (text cursor) location. ---- .. _class_TextEdit_method_has_keyword_color: - :ref:`bool` **has_keyword_color** **(** :ref:`String` keyword **)** |const| Returns whether the specified ``keyword`` has a color set to it or not. ---- .. _class_TextEdit_method_has_redo: - :ref:`bool` **has_redo** **(** **)** |const| Returns ``true`` if a "redo" action is available. ---- .. _class_TextEdit_method_has_undo: - :ref:`bool` **has_undo** **(** **)** |const| Returns ``true`` if an "undo" action is available. ---- .. _class_TextEdit_method_insert_text_at_cursor: - void **insert_text_at_cursor** **(** :ref:`String` text **)** Insert the specified text at the cursor position. ---- .. _class_TextEdit_method_is_folded: - :ref:`bool` **is_folded** **(** :ref:`int` line **)** |const| Returns whether the line at the specified index is folded or not. ---- .. _class_TextEdit_method_is_line_hidden: - :ref:`bool` **is_line_hidden** **(** :ref:`int` line **)** |const| Returns whether the line at the specified index is hidden or not. ---- .. _class_TextEdit_method_is_line_set_as_bookmark: - :ref:`bool` **is_line_set_as_bookmark** **(** :ref:`int` line **)** |const| Returns ``true`` when the specified ``line`` is bookmarked. ---- .. _class_TextEdit_method_is_line_set_as_breakpoint: - :ref:`bool` **is_line_set_as_breakpoint** **(** :ref:`int` line **)** |const| Returns ``true`` when the specified ``line`` has a breakpoint. ---- .. _class_TextEdit_method_is_line_set_as_safe: - :ref:`bool` **is_line_set_as_safe** **(** :ref:`int` line **)** |const| Returns ``true`` when the specified ``line`` is marked as safe. ---- .. _class_TextEdit_method_is_line_wrapped: - :ref:`bool` **is_line_wrapped** **(** :ref:`int` line **)** |const| Returns if the given line is wrapped. ---- .. _class_TextEdit_method_is_mouse_over_selection: - :ref:`bool` **is_mouse_over_selection** **(** :ref:`bool` edges **)** |const| Returns whether the mouse is over selection. If ``edges`` is ``true``, the edges are considered part of the selection. ---- .. _class_TextEdit_method_is_selection_active: - :ref:`bool` **is_selection_active** **(** **)** |const| Returns ``true`` if the selection is active. ---- .. _class_TextEdit_method_menu_option: - void **menu_option** **(** :ref:`int` option **)** Triggers a right-click menu action by the specified index. See :ref:`MenuItems` for a list of available indexes. ---- .. _class_TextEdit_method_paste: - void **paste** **(** **)** Paste the current selection. ---- .. _class_TextEdit_method_redo: - void **redo** **(** **)** Perform redo operation. ---- .. _class_TextEdit_method_remove_breakpoints: - void **remove_breakpoints** **(** **)** Removes all the breakpoints. This will not fire the :ref:`breakpoint_toggled` signal. ---- .. _class_TextEdit_method_search: - :ref:`PoolIntArray` **search** **(** :ref:`String` key, :ref:`int` flags, :ref:`int` from_line, :ref:`int` from_column **)** |const| Perform a search inside the text. Search flags can be specified in the :ref:`SearchFlags` enum. Returns an empty ``PoolIntArray`` if no result was found. Otherwise, the result line and column can be accessed at indices specified in the :ref:`SearchResult` enum, e.g: :: var result = search(key, flags, line, column) if result.size() > 0: # Result found. var res_line = result[TextEdit.SEARCH_RESULT_LINE] var res_column = result[TextEdit.SEARCH_RESULT_COLUMN] ---- .. _class_TextEdit_method_select: - void **select** **(** :ref:`int` from_line, :ref:`int` from_column, :ref:`int` to_line, :ref:`int` to_column **)** Perform selection, from line/column to line/column. If :ref:`selecting_enabled` is ``false``, no selection will occur. ---- .. _class_TextEdit_method_select_all: - void **select_all** **(** **)** Select all the text. If :ref:`selecting_enabled` is ``false``, no selection will occur. ---- .. _class_TextEdit_method_set_line: - void **set_line** **(** :ref:`int` line, :ref:`String` new_text **)** Sets the text for a specific line. ---- .. _class_TextEdit_method_set_line_as_bookmark: - void **set_line_as_bookmark** **(** :ref:`int` line, :ref:`bool` bookmark **)** Bookmarks the ``line`` if ``bookmark`` is ``true``. Deletes the bookmark if ``bookmark`` is ``false``. Bookmarks are shown in the :ref:`breakpoint_gutter`. ---- .. _class_TextEdit_method_set_line_as_breakpoint: - void **set_line_as_breakpoint** **(** :ref:`int` line, :ref:`bool` breakpoint **)** Adds or removes the breakpoint in ``line``. Breakpoints are shown in the :ref:`breakpoint_gutter`. ---- .. _class_TextEdit_method_set_line_as_hidden: - void **set_line_as_hidden** **(** :ref:`int` line, :ref:`bool` enable **)** If ``true``, hides the line of the specified index. ---- .. _class_TextEdit_method_set_line_as_safe: - void **set_line_as_safe** **(** :ref:`int` line, :ref:`bool` safe **)** If ``true``, marks the ``line`` as safe. This will show the line number with the color provided in the ``safe_line_number_color`` theme property. ---- .. _class_TextEdit_method_toggle_fold_line: - void **toggle_fold_line** **(** :ref:`int` line **)** Toggle the folding of the code block at the given line. ---- .. _class_TextEdit_method_undo: - void **undo** **(** **)** Perform undo operation. ---- .. _class_TextEdit_method_unfold_line: - void **unfold_line** **(** :ref:`int` line **)** Unfolds the given line, if folded. ---- .. _class_TextEdit_method_unhide_all_lines: - void **unhide_all_lines** **(** **)** Unhide all lines that were previously set to hidden by :ref:`set_line_as_hidden`. Theme Property Descriptions --------------------------- .. _class_TextEdit_theme_color_background_color: - :ref:`Color` **background_color** +-----------+-------------------------+ | *Default* | ``Color( 0, 0, 0, 0 )`` | +-----------+-------------------------+ Sets the background :ref:`Color` of this ``TextEdit``. :ref:`syntax_highlighting` has to be enabled. ---- .. _class_TextEdit_theme_color_bookmark_color: - :ref:`Color` **bookmark_color** +-----------+----------------------------------+ | *Default* | ``Color( 0.08, 0.49, 0.98, 1 )`` | +-----------+----------------------------------+ Sets the :ref:`Color` of the bookmark marker. :ref:`syntax_highlighting` has to be enabled. ---- .. _class_TextEdit_theme_color_brace_mismatch_color: - :ref:`Color` **brace_mismatch_color** +-----------+-----------------------------+ | *Default* | ``Color( 1, 0.2, 0.2, 1 )`` | +-----------+-----------------------------+ ---- .. _class_TextEdit_theme_color_breakpoint_color: - :ref:`Color` **breakpoint_color** +-----------+---------------------------------+ | *Default* | ``Color( 0.8, 0.8, 0.4, 0.2 )`` | +-----------+---------------------------------+ Sets the :ref:`Color` of the breakpoints. :ref:`breakpoint_gutter` has to be enabled. ---- .. _class_TextEdit_theme_color_caret_background_color: - :ref:`Color` **caret_background_color** +-----------+-------------------------+ | *Default* | ``Color( 0, 0, 0, 1 )`` | +-----------+-------------------------+ ---- .. _class_TextEdit_theme_color_caret_color: - :ref:`Color` **caret_color** +-----------+----------------------------------+ | *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | +-----------+----------------------------------+ ---- .. _class_TextEdit_theme_color_code_folding_color: - :ref:`Color` **code_folding_color** +-----------+---------------------------------+ | *Default* | ``Color( 0.8, 0.8, 0.8, 0.8 )`` | +-----------+---------------------------------+ ---- .. _class_TextEdit_theme_color_completion_background_color: - :ref:`Color` **completion_background_color** +-----------+---------------------------------+ | *Default* | ``Color( 0.17, 0.16, 0.2, 1 )`` | +-----------+---------------------------------+ ---- .. _class_TextEdit_theme_color_completion_existing_color: - :ref:`Color` **completion_existing_color** +-----------+-------------------------------------+ | *Default* | ``Color( 0.87, 0.87, 0.87, 0.13 )`` | +-----------+-------------------------------------+ ---- .. _class_TextEdit_theme_color_completion_font_color: - :ref:`Color` **completion_font_color** +-----------+----------------------------------+ | *Default* | ``Color( 0.67, 0.67, 0.67, 1 )`` | +-----------+----------------------------------+ ---- .. _class_TextEdit_theme_color_completion_scroll_color: - :ref:`Color` **completion_scroll_color** +-----------+----------------------------+ | *Default* | ``Color( 1, 1, 1, 0.29 )`` | +-----------+----------------------------+ ---- .. _class_TextEdit_theme_color_completion_selected_color: - :ref:`Color` **completion_selected_color** +-----------+----------------------------------+ | *Default* | ``Color( 0.26, 0.26, 0.27, 1 )`` | +-----------+----------------------------------+ ---- .. _class_TextEdit_theme_color_current_line_color: - :ref:`Color` **current_line_color** +-----------+------------------------------------+ | *Default* | ``Color( 0.25, 0.25, 0.26, 0.8 )`` | +-----------+------------------------------------+ Sets the :ref:`Color` of the breakpoints. :ref:`breakpoint_gutter` has to be enabled. ---- .. _class_TextEdit_theme_color_executing_line_color: - :ref:`Color` **executing_line_color** +-----------+---------------------------------+ | *Default* | ``Color( 0.2, 0.8, 0.2, 0.4 )`` | +-----------+---------------------------------+ ---- .. _class_TextEdit_theme_color_font_color: - :ref:`Color` **font_color** +-----------+----------------------------------+ | *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | +-----------+----------------------------------+ Sets the font :ref:`Color`. ---- .. _class_TextEdit_theme_color_font_color_readonly: - :ref:`Color` **font_color_readonly** +-----------+------------------------------------+ | *Default* | ``Color( 0.88, 0.88, 0.88, 0.5 )`` | +-----------+------------------------------------+ ---- .. _class_TextEdit_theme_color_font_color_selected: - :ref:`Color` **font_color_selected** +-----------+-------------------------+ | *Default* | ``Color( 0, 0, 0, 1 )`` | +-----------+-------------------------+ Sets the :ref:`Color` of the selected text. :ref:`override_selected_font_color` has to be enabled. ---- .. _class_TextEdit_theme_color_function_color: - :ref:`Color` **function_color** +-----------+---------------------------------+ | *Default* | ``Color( 0.4, 0.64, 0.81, 1 )`` | +-----------+---------------------------------+ ---- .. _class_TextEdit_theme_color_line_number_color: - :ref:`Color` **line_number_color** +-----------+------------------------------------+ | *Default* | ``Color( 0.67, 0.67, 0.67, 0.4 )`` | +-----------+------------------------------------+ Sets the :ref:`Color` of the line numbers. :ref:`show_line_numbers` has to be enabled. ---- .. _class_TextEdit_theme_color_mark_color: - :ref:`Color` **mark_color** +-----------+-------------------------------+ | *Default* | ``Color( 1, 0.4, 0.4, 0.4 )`` | +-----------+-------------------------------+ Sets the :ref:`Color` of marked text. ---- .. _class_TextEdit_theme_color_member_variable_color: - :ref:`Color` **member_variable_color** +-----------+---------------------------------+ | *Default* | ``Color( 0.9, 0.31, 0.35, 1 )`` | +-----------+---------------------------------+ ---- .. _class_TextEdit_theme_color_number_color: - :ref:`Color` **number_color** +-----------+---------------------------------+ | *Default* | ``Color( 0.92, 0.58, 0.2, 1 )`` | +-----------+---------------------------------+ ---- .. _class_TextEdit_theme_color_safe_line_number_color: - :ref:`Color` **safe_line_number_color** +-----------+------------------------------------+ | *Default* | ``Color( 0.67, 0.78, 0.67, 0.6 )`` | +-----------+------------------------------------+ ---- .. _class_TextEdit_theme_color_selection_color: - :ref:`Color` **selection_color** +-----------+----------------------------------+ | *Default* | ``Color( 0.49, 0.49, 0.49, 1 )`` | +-----------+----------------------------------+ Sets the highlight :ref:`Color` of text selections. ---- .. _class_TextEdit_theme_color_symbol_color: - :ref:`Color` **symbol_color** +-----------+----------------------------------+ | *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | +-----------+----------------------------------+ ---- .. _class_TextEdit_theme_color_word_highlighted_color: - :ref:`Color` **word_highlighted_color** +-----------+----------------------------------+ | *Default* | ``Color( 0.8, 0.9, 0.9, 0.15 )`` | +-----------+----------------------------------+ Sets the highlight :ref:`Color` of multiple occurrences. :ref:`highlight_all_occurrences` has to be enabled. ---- .. _class_TextEdit_theme_constant_completion_lines: - :ref:`int` **completion_lines** +-----------+-------+ | *Default* | ``7`` | +-----------+-------+ ---- .. _class_TextEdit_theme_constant_completion_max_width: - :ref:`int` **completion_max_width** +-----------+--------+ | *Default* | ``50`` | +-----------+--------+ ---- .. _class_TextEdit_theme_constant_completion_scroll_width: - :ref:`int` **completion_scroll_width** +-----------+-------+ | *Default* | ``6`` | +-----------+-------+ ---- .. _class_TextEdit_theme_constant_line_spacing: - :ref:`int` **line_spacing** +-----------+-------+ | *Default* | ``4`` | +-----------+-------+ Sets the spacing between the lines. ---- .. _class_TextEdit_theme_font_font: - :ref:`Font` **font** Sets the default :ref:`Font`. ---- .. _class_TextEdit_theme_icon_fold: - :ref:`Texture` **fold** ---- .. _class_TextEdit_theme_icon_folded: - :ref:`Texture` **folded** ---- .. _class_TextEdit_theme_icon_space: - :ref:`Texture` **space** ---- .. _class_TextEdit_theme_icon_tab: - :ref:`Texture` **tab** Sets a custom :ref:`Texture` for tab text characters. ---- .. _class_TextEdit_theme_style_completion: - :ref:`StyleBox` **completion** ---- .. _class_TextEdit_theme_style_focus: - :ref:`StyleBox` **focus** ---- .. _class_TextEdit_theme_style_normal: - :ref:`StyleBox` **normal** Sets the :ref:`StyleBox` of this ``TextEdit``. ---- .. _class_TextEdit_theme_style_read_only: - :ref:`StyleBox` **read_only** Sets the :ref:`StyleBox` of this ``TextEdit`` when :ref:`readonly` is enabled. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`