Multiline text editing control.
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.
[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.
Returns if the given line is foldable, that is, it has indented lines right below it.
Centers the viewport on the line the editing cursor is at. This also resets the [member scroll_horizontal] value to [code]0[/code].
Removes all OpenType features.
Clears the undo history.
Copy's the current text selection.
Returns the column the editing cursor is at.
Returns the line the editing cursor is at.
Moves the cursor at the specified [code]column[/code] index.
If [code]adjust_viewport[/code] is set to [code]true[/code], the viewport will center at the cursor position after the move occurs.
Moves the cursor at the specified [code]line[/code] index.
If [code]adjust_viewport[/code] is set to [code]true[/code], the viewport will center at the cursor position after the move occurs.
If [code]can_be_hidden[/code] is set to [code]true[/code], the specified [code]line[/code] can be hidden using [method set_line_as_hidden].
Cut's the current selection.
Deselects the current selection.
Folds all lines that are possible to be folded (see [method can_fold]).
Folds the given line, if possible (see [method can_fold]).
Returns the text of a specific line.
Returns the amount of total lines in the text.
Returns the [PopupMenu] of this [TextEdit]. By default, this menu is displayed when right-clicking on the [TextEdit].
Returns OpenType feature [code]tag[/code].
Returns the selection begin column.
Returns the selection begin line.
Returns the text inside the selection.
Returns the selection end column.
Returns the selection end line.
Returns the number of visible lines, including wrapped text.
Returns a [String] text with the word under the caret (text cursor) location.
Insert the specified text at the cursor position.
Returns whether the line at the specified index is folded or not.
Returns whether the line at the specified index is hidden or not.
Returns [code]true[/code] if the selection is active.
Triggers a right-click menu action by the specified index. See [enum MenuItems] for a list of available indexes.
Paste the current selection.
Perform redo operation.
Perform a search inside the text. Search flags can be specified in the [enum SearchFlags] enum.
Returns an empty [code]Dictionary[/code] if no result was found. Otherwise, returns a [code]Dictionary[/code] containing [code]line[/code] and [code]column[/code] entries, e.g:
[codeblocks]
[gdscript]
var result = search("print", SEARCH_WHOLE_WORDS, 0, 0)
if !result.empty():
# Result found.
var line_number = result.line
var column_number = result.column
[/gdscript]
[csharp]
int[] result = Search("print", (uint)TextEdit.SearchFlags.WholeWords, 0, 0);
if (result.Length > 0)
{
// Result found.
int lineNumber = result[(int)TextEdit.SearchResult.Line];
int columnNumber = result[(int)TextEdit.SearchResult.Column];
}
[/csharp]
[/codeblocks]
Perform selection, from line/column to line/column.
If [member selecting_enabled] is [code]false[/code], no selection will occur.
Select all the text.
If [member selecting_enabled] is [code]false[/code], no selection will occur.
Sets the text for a specific line.
If [code]true[/code], hides the line of the specified index.
Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
Toggle the folding of the code block at the given line.
Perform undo operation.
Unfolds the given line, if folded.
Unhide all lines that were previously set to hidden by [method set_line_as_hidden].
If [code]true[/code], the caret (visual cursor) blinks.
Duration (in seconds) of a caret's blinking cycle.
If [code]true[/code], the caret displays as a rectangle.
If [code]false[/code], the caret displays as a bar.
Allow moving caret, selecting and removing the individual composite character components.
Note: [kbd]Backspace[/kbd] is always removing individual composite character components.
If [code]true[/code], a right-click moves the cursor at the mouse position before displaying the context menu.
If [code]false[/code], the context menu disregards mouse location.
If [code]true[/code], a right-click displays the context menu.
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]true[/code], all lines that have been set to hidden by [method set_line_as_hidden], will not be visible.
If [code]true[/code], all occurrences of the selected text will be highlighted.
If [code]true[/code], the line containing the cursor is highlighted.
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
If [code]true[/code], a minimap is shown, providing an outline of your source code.
The width, in pixels, of the minimap.
If [code]true[/code], custom [code]font_selected_color[/code] will be used for selected text.
If [code]true[/code], read-only mode is enabled. Existing text cannot be modified and new text cannot be added.
If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels.
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.
If [code]true[/code], sets the [code]step[/code] of the scrollbars to [code]0.25[/code] which results in smoother scrolling.
Set BiDi algorithm override for the structured text.
Set additional options for BiDi override.
Sets the [SyntaxHighlighter] to use.
String value of the [TextEdit].
Base text writing direction.
Vertical scroll sensitivity.
If [code]true[/code], the native virtual keyboard is shown when focused on platforms that support it.
If [code]true[/code], enables text wrapping when it goes beyond the edge of what is visible.
Emitted when the cursor changes.
Emitted when the text changes.
Match case when searching.
Match whole words when searching.
Search from end to beginning.
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.
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.
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.
Represents the size of the [enum MenuItems] enum.
Sets the background [Color] of this [TextEdit].
Sets the [Color] of the breakpoints. [member breakpoint_gutter] has to be enabled.
Sets the default [Font].
Sets the font [Color].
The tint of text outline of the [TextEdit].
Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled.
Sets default font size.
Sets the spacing between the lines.
Sets the [Color] of marked text.
Sets the [StyleBox] of this [TextEdit].
The size of the text outline.
Sets the [StyleBox] of this [TextEdit] when [member readonly] is enabled.
Sets the highlight [Color] of text selections.
Sets a custom [Texture2D] for space text characters.
Sets a custom [Texture2D] for tab text characters.
Sets the highlight [Color] of multiple occurrences. [member highlight_all_occurrences] has to be enabled.