A multiline text editor.
A multiline text editor. It also has limited facilities for editing code, such as syntax highlighting support. For more advanced facilities for editing code, see [CodeEdit]. [b]Note:[/b] Most viewport, caret, and edit methods contain a [code]caret_index[/code] argument for [member caret_multiple] support. The argument should be one of the following: [code]-1[/code] for all carets, [code]0[/code] for the main caret, or greater than [code]0[/code] for secondary carets in the order they were created. [b]Note:[/b] When holding down [kbd]Alt[/kbd], the vertical scroll wheel will scroll 5 times as fast as it would normally do. This also works in the Godot script editor.
Override this method to define what happens when the user presses the backspace key.
Override this method to define what happens when the user performs a copy operation.
Override this method to define what happens when the user performs a cut operation.
Override this method to define what happens when the user types in the provided key [param unicode_char].
Override this method to define what happens when the user performs a paste operation.
Override this method to define what happens when the user performs a paste operation with middle mouse button. [b]Note:[/b] This method is only implemented on Linux.
Adds a new caret at the given location. Returns the index of the new caret, or [code]-1[/code] if the location is invalid.
Adds an additional caret above or below every caret. If [param below] is [code]true[/code] the new caret will be added below and above otherwise.
Register a new gutter to this [TextEdit]. Use [param at] to have a specific gutter order. A value of [code]-1[/code] appends the gutter to the right.
Adds a selection and a caret for the next occurrence of the current selection. If there is no active selection, selects word under caret.
This method does nothing.
Adjust the viewport so the caret is visible.
Applies text from the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME) to each caret and closes the IME if it is open.
Called when the user presses the backspace key. Can be overridden with [method _backspace].
Starts a multipart edit. All edits will be treated as one action until [method end_complex_operation] is called.
Starts an edit for multiple carets. The edit must be ended with [method end_multicaret_edit]. Multicaret edits can be used to edit text at multiple carets and delay merging the carets until the end, so the caret indexes aren't affected immediately. [method begin_multicaret_edit] and [method end_multicaret_edit] can be nested, and the merge will happen at the last [method end_multicaret_edit]. [codeblock] begin_complex_operation() begin_multicaret_edit() for i in range(get_caret_count()): if multicaret_edit_ignore_caret(i): continue # Logic here. end_multicaret_edit() end_complex_operation() [/codeblock]
Closes the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME) if it is open. Any text in the IME will be lost.
Centers the viewport on the line the editing caret is at. This also resets the [member scroll_horizontal] value to [code]0[/code].
Performs a full reset of [TextEdit], including undo history.
Clears the undo history.
Collapse all carets in the given range to the [param from_line] and [param from_column] position. [param inclusive] applies to both ends. If [method is_in_mulitcaret_edit] is [code]true[/code], carets that are collapsed will be [code]true[/code] for [method multicaret_edit_ignore_caret]. [method merge_overlapping_carets] will be called if any carets were collapsed.
Copies the current text selection. Can be overridden with [method _copy].
Cut's the current selection. Can be overridden with [method _cut].
Deletes the selected text.
Deselects the current selection.
Marks the end of steps in the current action started with [method start_action].
Ends a multipart edit, started with [method begin_complex_operation]. If called outside a complex operation, the current operation is pushed onto the undo/redo stack.
Ends an edit for multiple carets, that was started with [method begin_multicaret_edit]. If this was the last [method end_multicaret_edit] and [method merge_overlapping_carets] was called, carets will be merged.
Returns the column the editing caret is at.
Returns the number of carets in this [TextEdit].
Returns the caret pixel draw position.
Returns a list of caret indexes in their edit order, this done from bottom to top. Edit order refers to the way actions such as [method insert_text_at_caret] are applied.
Returns the line the editing caret is on.
Returns the wrap index the editing caret is on.
Returns the first column containing a non-whitespace character on the given line. If there is only whitespace, returns the number of characters.
Returns the first visible line.
Returns the number of gutters registered.
Returns the name of the gutter at the given index.
Returns the type of the gutter at the given index. Gutters can contain icons, text, or custom visuals. See [enum TextEdit.GutterType] for options.
Returns the width of the gutter at the given index.
Returns the [HScrollBar] used by [TextEdit].
Returns the indent level of the given line. This is the number of spaces and tabs at the beginning of the line, with the tabs taking the tab size into account (see [method get_tab_size]).
Returns the last visible line. Use [method get_last_full_visible_line_wrap_index] for the wrap index.
Returns the last visible wrap index of the last visible line.
Returns the last unhidden line in the entire [TextEdit].
Returns the text of a specific line.
Returns the custom background color of the given line. If no color is set, returns [code]Color(0, 0, 0, 0)[/code].
Returns the line and column at the given position. In the returned vector, [code]x[/code] is the column and [code]y[/code] is the line. If [param clamp_line] is [code]false[/code] and [param position] is below the last line, [code]Vector2i(-1, -1)[/code] is returned. If [param clamp_column] is [code]false[/code] and [param position] is outside the column range of the line, [code]Vector2i(-1, -1)[/code] is returned.
Returns the number of lines in the text.
Returns the icon currently in [param gutter] at [param line]. This only works when the gutter type is [constant GUTTER_TYPE_ICON] (see [method set_gutter_type]).
Returns the color currently in [param gutter] at [param line].
Returns the metadata currently in [param gutter] at [param line].
Returns the text currently in [param gutter] at [param line]. This only works when the gutter type is [constant GUTTER_TYPE_STRING] (see [method set_gutter_type]).
Returns the maximum value of the line height among all lines. [b]Note:[/b] The return value is influenced by [theme_item line_spacing] and [theme_item font_size]. And it will not be less than [code]1[/code].
Returns an [Array] of line ranges where [code]x[/code] is the first line and [code]y[/code] is the last line. All lines within these ranges will have a caret on them or be part of a selection. Each line will only be part of one line range, even if it has multiple carets on it. If a selection's end column ([method get_selection_to_column]) is at column [code]0[/code], that line will not be included. If a selection begins on the line after another selection ends and [param merge_adjacent] is [code]true[/code], or they begin and end on the same line, one line range will include both selections.
Returns the width in pixels of the [param wrap_index] on [param line].
Returns line text as it is currently displayed, including IME composition string.
Returns the number of times the given line is wrapped.
Returns the wrap index of the given column on the given line. This ranges from [code]0[/code] to [method get_line_wrap_count].
Returns an array of [String]s representing each wrapped index.
Returns the local mouse position adjusted for the text direction.
Returns the [PopupMenu] of this [TextEdit]. By default, this menu is displayed when right-clicking on the [TextEdit]. You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see [enum MenuItems]). For example: [codeblocks] [gdscript] func _ready(): var menu = get_menu() # Remove all items after "Redo". menu.item_count = menu.get_item_index(MENU_REDO) + 1 # Add custom items. menu.add_separator() menu.add_item("Insert Date", MENU_MAX + 1) # Connect callback. menu.id_pressed.connect(_on_item_pressed)

func _on_item_pressed(id): if id == MENU_MAX + 1: insert_text_at_caret(Time.get_date_string_from_system()) [/gdscript] [csharp] public override void _Ready() { var menu = GetMenu(); // Remove all items after "Redo". menu.ItemCount = menu.GetItemIndex(TextEdit.MenuItems.Redo) + 1; // Add custom items. menu.AddSeparator(); menu.AddItem("Insert Date", TextEdit.MenuItems.Max + 1); // Add event handler. menu.IdPressed += OnItemPressed; }

public void OnItemPressed(int id) { if (id == TextEdit.MenuItems.Max + 1) { InsertTextAtCaret(Time.GetDateStringFromSystem()); } } [/csharp] [/codeblocks] [b]Warning:[/b] 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 [member Window.visible] property.
Returns the equivalent minimap line at [param position].
Returns the number of lines that may be drawn on the minimap.
Similar to [method get_next_visible_line_offset_from], but takes into account the line wrap indexes. In the returned vector, [code]x[/code] is the line, [code]y[/code] is the wrap index.
Returns the count to the next visible line from [param line] to [code]line + visible_amount[/code]. Can also count backwards. For example if a [TextEdit] has 5 lines with lines 2 and 3 hidden, calling this with [code]line = 1, visible_amount = 1[/code] would return 3.
Returns the local position for the given [param line] and [param column]. If [code]x[/code] or [code]y[/code] of the returned vector equal [code]-1[/code], the position is outside of the viewable area of the control. [b]Note:[/b] The Y position corresponds to the bottom side of the line. Use [method get_rect_at_line_column] to get the top side position.
Returns the local position and size for the grapheme at the given [param line] and [param column]. If [code]x[/code] or [code]y[/code] position of the returned rect equal [code]-1[/code], the position is outside of the viewable area of the control. [b]Note:[/b] The Y position of the returned rect corresponds to the top side of the line, unlike [method get_pos_at_line_column] which returns the bottom side.
Returns the last tagged saved version from [method tag_saved_version].
Returns the scroll position for [param wrap_index] of [param line].
Returns the text inside the selection of a caret, or all the carets if [param caret_index] is its default value [code]-1[/code].
Returns the caret index of the selection at the given [param line] and [param column], or [code]-1[/code] if there is none. If [param include_edges] is [code]false[/code], the position must be inside the selection and not at either end. If [param only_selections] is [code]false[/code], carets without a selection will also be considered.
Returns the original start column of the selection.
Returns the selection begin column. Returns the caret column if there is no selection.
Returns the selection begin line. Returns the caret line if there is no selection.
Returns the original start line of the selection.
Returns the current selection mode.
Returns the origin column of the selection. This is the opposite end from the caret.
Returns the origin line of the selection. This is the opposite end from the caret.
Returns the selection end column. Returns the caret column if there is no selection.
Returns the selection end line. Returns the caret line if there is no selection.
Returns the carets sorted by selection beginning from lowest line and column to highest (from top to bottom of text). If [param include_ignored_carets] is [code]false[/code], carets from [method multicaret_edit_ignore_caret] will be ignored.
Returns the [TextEdit]'s' tab size.
Returns the total width of all gutters and internal padding.
Returns the total number of lines in the text. This includes wrapped lines and excludes folded lines. If [member wrap_mode] is set to [constant LINE_WRAPPING_NONE] and no lines are folded (see [method CodeEdit.is_line_folded]) then this is equivalent to [method get_line_count]. See [method get_visible_line_count_in_range] for a limited range of lines.
Returns the [VScrollBar] of the [TextEdit].
Returns the current version of the [TextEdit]. The version is a count of recorded operations by the undo/redo history.
Returns the number of lines that can visually fit, rounded down, based on this control's height.
Returns the total number of lines between [param from_line] and [param to_line] (inclusive) in the text. This includes wrapped lines and excludes folded lines. If the range covers all lines it is equivalent to [method get_total_visible_line_count].
Returns the word at [param position].
Returns a [String] text with the word under the caret's location.
Returns [code]true[/code] if the user has text in the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME).
Returns [code]true[/code] if a "redo" action is available.
Returns [code]true[/code] if the user has selected text.
Returns [code]true[/code] if an "undo" action is available.
Inserts a new line with [param text] at [param line].
Inserts the [param text] at [param line] and [param column]. If [param before_selection_begin] is [code]true[/code], carets and selections that begin at [param line] and [param column] will moved to the end of the inserted text, along with all carets after it. If [param before_selection_end] is [code]true[/code], selections that end at [param line] and [param column] will be extended to the end of the inserted text. These parameters can be used to insert text inside of or outside of selections.
Insert the specified text at the caret position.
Returns [code]true[/code] if the caret of the selection is after the selection origin. This can be used to determine the direction of the selection.
Returns [code]true[/code] if the caret is visible, [code]false[/code] otherwise. A caret will be considered hidden if it is outside the scrollable area when scrolling is enabled. [b]Note:[/b] [method is_caret_visible] does not account for a caret being off-screen if it is still within the scrollable area. It will return [code]true[/code] even if the caret is off-screen as long as it meets [TextEdit]'s own conditions for being visible. This includes uses of [member scroll_fit_content_width] and [member scroll_fit_content_height] that cause the [TextEdit] to expand beyond the viewport's bounds.
Returns [code]true[/code] if the user is dragging their mouse for scrolling, selecting, or text dragging.
Returns [code]true[/code] if the gutter at the given index is clickable. See [method set_gutter_clickable].
Returns [code]true[/code] if the gutter at the given index is currently drawn. See [method set_gutter_draw].
Returns [code]true[/code] if the gutter at the given index is overwritable. See [method set_gutter_overwritable].
Returns [code]true[/code] if a [method begin_multicaret_edit] has been called and [method end_multicaret_edit] has not yet been called.
Returns [code]true[/code] if the gutter at the given index on the given line is clickable. See [method set_line_gutter_clickable].
Returns if the given line is wrapped.
Returns [code]true[/code] if the menu is visible. Use this instead of [code]get_menu().visible[/code] to improve performance (so the creation of the menu is avoided). See [method get_menu].
Returns [code]true[/code] if the mouse is over a selection. If [param edges] is [code]true[/code], the edges are considered part of the selection.
Returns [code]true[/code] if overtype mode is enabled. See [method set_overtype_mode_enabled].
Executes a given action as defined in the [enum MenuItems] enum.
Merge the gutters from [param from_line] into [param to_line]. Only overwritable gutters will be copied. See [method set_gutter_overwritable].
Merges any overlapping carets. Will favor the newest caret, or the caret with a selection. If [method is_in_mulitcaret_edit] is [code]true[/code], the merge will be queued to happen at the end of the multicaret edit. See [method begin_multicaret_edit] and [method end_multicaret_edit]. [b]Note:[/b] This is not called when a caret changes position but after certain actions, so it is possible to get into a state where carets overlap.
Returns [code]true[/code] if the given [param caret_index] should be ignored as part of a multicaret edit. See [method begin_multicaret_edit] and [method end_multicaret_edit]. Carets that should be ignored are ones that were part of removed text and will likely be merged at the end of the edit, or carets that were added during the edit. It is recommended to [code]continue[/code] within a loop iterating on multiple carets if a caret should be ignored.
Paste at the current location. Can be overridden with [method _paste].
Pastes the primary clipboard.
Perform redo operation.
Removes the given caret index. [b]Note:[/b] This can result in adjustment of all other caret indices.
Removes the gutter at the given index.
Removes the line of text at [param line]. Carets on this line will attempt to match their previous visual x position. If [param move_carets_down] is [code]true[/code] carets will move to the next line down, otherwise carets will move up.
Removes all additional carets.
Removes text between the given positions.
Perform a search inside the text. Search flags can be specified in the [enum SearchFlags] enum. In the returned vector, [code]x[/code] is the column, [code]y[/code] is the line. If no results are found, both are equal to [code]-1[/code]. [codeblocks] [gdscript] var result = search("print", SEARCH_WHOLE_WORDS, 0, 0) if result.x != -1: # Result found. var line_number = result.y var column_number = result.x [/gdscript] [csharp] Vector2I result = Search("print", (uint)TextEdit.SearchFlags.WholeWords, 0, 0); if (result.X != -1) { // Result found. int lineNumber = result.Y; int columnNumber = result.X; } [/csharp] [/codeblocks]
Selects text from [param origin_line] and [param origin_column] to [param caret_line] and [param caret_column] for the given [param caret_index]. This moves the selection origin and the caret. If the positions are the same, the selection will be deselected. If [member selecting_enabled] is [code]false[/code], no selection will occur. [b]Note:[/b] If supporting multiple carets this will not check for any overlap. See [method merge_overlapping_carets].
Select all the text. If [member selecting_enabled] is [code]false[/code], no selection will occur.
Selects the word under the caret.
Moves the caret to the specified [param column] index. If [param adjust_viewport] is [code]true[/code], the viewport will center at the caret position after the move occurs. [b]Note:[/b] If supporting multiple carets this will not check for any overlap. See [method merge_overlapping_carets].
Moves the caret to the specified [param line] index. The caret column will be moved to the same visual position it was at the last time [method set_caret_column] was called, or clamped to the end of the line. If [param adjust_viewport] is [code]true[/code], the viewport will center at the caret position after the move occurs. If [param can_be_hidden] is [code]true[/code], the specified [param line] can be hidden. If [param wrap_index] is [code]-1[/code], the caret column will be clamped to the [param line]'s length. If [param wrap_index] is greater than [code]-1[/code], the column will be moved to attempt to match the visual x position on the line's [param wrap_index] to the position from the last time [method set_caret_column] was called. [b]Note:[/b] If supporting multiple carets this will not check for any overlap. See [method merge_overlapping_carets].
If [code]true[/code], the mouse cursor will change to a pointing hand ([constant Control.CURSOR_POINTING_HAND]) when hovering over the gutter at the given index. See [method is_gutter_clickable] and [method set_line_gutter_clickable].
Set a custom draw callback for the gutter at the given index. [param draw_callback] must take the following arguments: A line index [int], a gutter index [int], and an area [Rect2]. This callback only works when the gutter type is [constant GUTTER_TYPE_CUSTOM] (see [method set_gutter_type]).
If [code]true[/code], the gutter at the given index is drawn. The gutter type ([method set_gutter_type]) determines how it is drawn. See [method is_gutter_drawn].
Sets the name of the gutter at the given index.
If [code]true[/code], the line data of the gutter at the given index can be overridden when using [method merge_gutters]. See [method is_gutter_overwritable].
Sets the type of gutter at the given index. Gutters can contain icons, text, or custom visuals. See [enum TextEdit.GutterType] for options.
Set the width of the gutter at the given index.
Sets the text for a specific [param line]. Carets on the line will attempt to keep their visual x position.
Positions the [param wrap_index] of [param line] at the center of the viewport.
Positions the [param wrap_index] of [param line] at the top of the viewport.
Positions the [param wrap_index] of [param line] at the bottom of the viewport.
Sets the custom background color of the given line. If transparent, this color is applied on top of the default background color (See [theme_item background_color]). If set to [code]Color(0, 0, 0, 0)[/code], no additional color is applied.
If [param clickable] is [code]true[/code], makes the [param gutter] on the given [param line] clickable. This is like [method set_gutter_clickable], but for a single line. If [method is_gutter_clickable] is [code]true[/code], this will not have any effect. See [method is_line_gutter_clickable] and [signal gutter_clicked].
Sets the icon for [param gutter] on [param line] to [param icon]. This only works when the gutter type is [constant GUTTER_TYPE_ICON] (see [method set_gutter_type]).
Sets the color for [param gutter] on [param line] to [param color].
Sets the metadata for [param gutter] on [param line] to [param metadata].
Sets the text for [param gutter] on [param line] to [param text]. This only works when the gutter type is [constant GUTTER_TYPE_STRING] (see [method set_gutter_type]).
If [code]true[/code], enables overtype mode. In this mode, typing overrides existing text instead of inserting text. The [member ProjectSettings.input/ui_text_toggle_insert_mode] action toggles overtype mode. See [method is_overtype_mode_enabled].
Sets the search [param flags]. This is used with [method set_search_text] to highlight occurrences of the searched text. Search flags can be specified from the [enum SearchFlags] enum.
Sets the search text. See [method set_search_flags].
Sets the current selection mode.
Sets the selection origin column to the [param column] for the given [param caret_index]. If the selection origin is moved to the caret position, the selection will deselect.
Sets the selection origin line to the [param line] for the given [param caret_index]. If the selection origin is moved to the caret position, the selection will deselect. If [param can_be_hidden] is [code]false[/code], The line will be set to the nearest unhidden line below or above. If [param wrap_index] is [code]-1[/code], the selection origin column will be clamped to the [param line]'s length. If [param wrap_index] is greater than [code]-1[/code], the column will be moved to attempt to match the visual x position on the line's [param wrap_index] to the position from the last time [method set_selection_origin_column] or [method select] was called.
Sets the tab size for the [TextEdit] to use.
Provide custom tooltip text. The callback method must take the following args: [code]hovered_word: String[/code].
Moves a selection and a caret for the next occurrence of the current selection. If there is no active selection, moves to the next occurrence of the word under caret.
Starts an action, will end the current action if [param action] is different. An action will also end after a call to [method end_action], after [member ProjectSettings.gui/timers/text_edit_idle_detect_sec] is triggered or a new undoable step outside the [method start_action] and [method end_action] calls.
Swaps the two lines. Carets will be swapped with the lines.
Tag the current version as saved.
Perform undo operation.
- If [member wrap_mode] is set to [constant LINE_WRAPPING_BOUNDARY], sets text wrapping mode. To see how each mode behaves, see [enum TextServer.AutowrapMode].
- If [code]true[/code], makes the caret blink.
- The interval at which the caret blinks (in seconds).
- If [code]true[/code], caret will be visible when [member editable] is disabled.
- Allow moving caret, selecting and removing the individual composite character components. [b]Note:[/b] [kbd]Backspace[/kbd] is always removing individual composite character components.
- If [code]true[/code], a right-click moves the caret at the mouse position before displaying the context menu. If [code]false[/code], the context menu ignores mouse location.
- If [code]true[/code], multiple carets are allowed. Left-clicking with [kbd]Alt[/kbd] adds a new caret. See [method add_caret] and [method get_caret_count].
- Set the type of caret to draw.
- If [code]true[/code], a right-click displays the context menu.
- The characters to consider as word delimiters if [member use_custom_word_separators] is [code]true[/code]. The characters should be defined without separation, for example [code]#_![/code].
- If [code]true[/code], the selected text will be deselected when focus is lost.
- If [code]true[/code], allow drag and drop of selected text. Text can still be dropped from other sources.
- If [code]true[/code], control characters are displayed.
- If [code]true[/code], the "space" character will have a visible representation.
- If [code]true[/code], the "tab" character will have a visible representation.
- If [code]false[/code], existing text cannot be modified and new text cannot be added.
- If [code]true[/code], "Emoji and Symbols" menu is enabled.
- If [code]true[/code], copying or cutting without a selection is performed on all lines with a caret. Otherwise, copy and cut require a selection.
- If [code]true[/code], all occurrences of the selected text will be highlighted.
- If [code]true[/code], the line containing the cursor is highlighted.
- If [code]true[/code], all wrapped lines are indented to the same amount as the unwrapped line.
- Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
- If [code]false[/code], using middle mouse button to paste clipboard will be disabled. [b]Note:[/b] This method is only implemented on Linux.
- If [code]true[/code], a minimap is shown, providing an outline of your source code. The minimap uses a fixed-width text size.
- The width, in pixels, of the minimap.
- Text shown when the [TextEdit] is empty. It is [b]not[/b] the [TextEdit]'s default value (see [member text]).
- If [code]true[/code], [TextEdit] will disable vertical scroll and fit minimum height to the number of visible lines. When both this property and [member scroll_fit_content_width] are [code]true[/code], no scrollbars will be displayed.
- If [code]true[/code], [TextEdit] will disable horizontal scroll and fit minimum width to the widest line in the text. When both this property and [member scroll_fit_content_height] are [code]true[/code], no scrollbars will be displayed.
- If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels.
- Allow scrolling past the last line into "virtual" space.
- Scroll smoothly over the text rather than jumping to the next location.
- Sets the scroll speed with the minimap or when [member scroll_smooth] is enabled.
- If there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line.
- If [code]true[/code], text can be selected. If [code]false[/code], text can not be selected by the user or by the [method select] or [method select_all] methods.
- If [code]true[/code], shortcut keys for context menu items are enabled, even if the context menu is disabled.
- Set BiDi algorithm override for the structured text.
- Set additional options for BiDi override.
- The syntax highlighter to use. [b]Note:[/b] A [SyntaxHighlighter] instance should not be used across multiple [TextEdit] nodes.
- String value of the [TextEdit].
- Base text writing direction.
- If [code]false[/code], using [kbd]Ctrl + Left[/kbd] or [kbd]Ctrl + Right[/kbd] ([kbd]Cmd + Left[/kbd] or [kbd]Cmd + Right[/kbd] on macOS) bindings will use the behavior of [member use_default_word_separators]. If [code]true[/code], it will also stop the caret if a character within [member custom_word_separators] is detected. Useful for subword moving. This behavior also will be applied to the behavior of text selection.
- If [code]false[/code], using [kbd]Ctrl + Left[/kbd] or [kbd]Ctrl + Right[/kbd] ([kbd]Cmd + Left[/kbd] or [kbd]Cmd + Right[/kbd] on macOS) bindings will stop moving caret only if a space or punctuation is detected. If [code]true[/code], it will also stop the caret if a character is part of [code]!"#$%&'()*+,-./:;<=>?@[\]^`{|}~[/code], the Unicode General Punctuation table, or the Unicode CJK Punctuation table. Useful for subword moving. This behavior also will be applied to the behavior of text selection.
- If [code]true[/code], the native virtual keyboard is shown when focused on platforms that support it.
- Sets the line wrapping mode to use.
Emitted when any caret changes position.
Emitted when a gutter is added.
Emitted when a gutter is clicked.
Emitted when a gutter is removed.
Emitted immediately when the text changes. When text is added [param from_line] will be less than [param to_line]. On a remove [param to_line] will be less than [param from_line].
Emitted when the text changes.
Emitted when [method clear] is called or [member text] is set.
Cuts (copies and clears) the selected text.
Copies the selected text.
Pastes the clipboard text over the selected text (or at the cursor's position).
Erases the whole [TextEdit] text.
Selects the whole [TextEdit] text.
Undoes the previous action.
Redoes the previous action.
ID of "Text Writing Direction" submenu.
Sets text direction to inherited.
Sets text direction to automatic.
Sets text direction to left-to-right.
Sets text direction to right-to-left.
Toggles control character display.
ID of "Insert Control Character" submenu.
Inserts left-to-right mark (LRM) character.
Inserts right-to-left mark (RLM) character.
Inserts start of left-to-right embedding (LRE) character.
Inserts start of right-to-left embedding (RLE) character.
Inserts start of left-to-right override (LRO) character.
Inserts start of right-to-left override (RLO) character.
Inserts pop direction formatting (PDF) character.
Inserts Arabic letter mark (ALM) character.
Inserts left-to-right isolate (LRI) character.
Inserts right-to-left isolate (RLI) character.
Inserts first strong isolate (FSI) character.
Inserts pop direction isolate (PDI) character.
Inserts zero width joiner (ZWJ) character.
Inserts zero width non-joiner (ZWNJ) character.
Inserts word joiner (WJ) character.
Inserts soft hyphen (SHY) character.
Opens system emoji and symbol picker.
Represents the size of the [enum MenuItems] enum.
No current action.
A typing action.
A backwards delete action.
A forward delete action.
Match case when searching.
Match whole words when searching.
Search from end to beginning.
Vertical line caret.
Block caret.
Not selecting.
Select as if [code]shift[/code] is pressed.
Select single characters as if the user single clicked.
Select whole words as if the user double clicked.
Select whole lines as if the user triple clicked.
Line wrapping is disabled.
Line wrapping occurs at the control boundary, beyond what would normally be visible.
When a gutter is set to string using [method set_gutter_type], it is used to contain text set via the [method set_line_gutter_text] method.
When a gutter is set to icon using [method set_gutter_type], it is used to contain an icon set via the [method set_line_gutter_icon] method.
When a gutter is set to custom using [method set_gutter_type], it is used to contain custom visuals controlled by a callback method set via the [method set_gutter_custom_draw] method.
Sets the background [Color] of this [TextEdit].
[Color] of the text behind the caret when using a block caret.
[Color] of the caret. This can be set to a fully transparent color to hide the caret entirely.
Background [Color] of the line containing the caret.
Sets the font [Color].
The tint of text outline of the [TextEdit].
Font color for [member placeholder_text].
Sets the font [Color] when [member editable] is disabled.
Sets the [Color] of the selected text. If equal to [code]Color(0, 0, 0, 0)[/code], it will be ignored.
[Color] of the border around text that matches the search query.
[Color] behind the text that matches the search query.
Sets the highlight [Color] of text selections.
Sets the highlight [Color] of multiple occurrences. [member highlight_all_occurrences] has to be enabled.
The caret's width in pixels. Greater values can be used to improve accessibility by ensuring the caret is easily visible, or to ensure consistency with a large font size. If set to [code]0[/code] or lower, the caret width is automatically set to 1 pixel and multiplied by the display scaling factor.
Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
The size of the text outline. [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
Sets the default [Font].
Sets default font size.
Sets a custom [Texture2D] for space text characters.
Sets a custom [Texture2D] for tab text characters.
Sets the [StyleBox] when in focus. The [theme_item focus] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
Sets the [StyleBox] of this [TextEdit].
Sets the [StyleBox] of this [TextEdit] when [member editable] is disabled.