var autowrapMode: TextServer.AutowrapModeIf wrapMode is set to .lineWrappingBoundary, sets text wrapping mode. To see how each mode behaves, see TextServer.AutowrapMode.
var caretBlink: BoolIf true, makes the caret blink.
var caretBlinkInterval: DoubleThe interval at which the caret blinks (in seconds).
var caretChanged: SimpleSignalEmitted when any caret changes position.
var caretDrawWhenEditableDisabled: BoolIf true, caret will be visible when editable is disabled.
var caretMidGrapheme: BoolAllow moving caret, selecting and removing the individual composite character components.
var caretMoveOnRightClick: BoolIf true, a right-click moves the caret at the mouse position before displaying the context menu.
var caretMultiple: BoolSets if multiple carets are allowed.
var caretType: TextEdit.CaretTypeSet the type of caret to draw.
var deselectOnFocusLossEnabled: BoolIf true, the selected text will be deselected when focus is lost.
var dragAndDropSelectionEnabled: BoolIf true, allow drag and drop of selected text. Text can still be dropped from other sources.
var drawSpaces: BoolIf true, the “space” character will have a visible representation.
var drawTabs: BoolIf true, the “tab” character will have a visible representation.
var editable: BoolIf false, existing text cannot be modified and new text cannot be added.
var gutterAdded: SimpleSignalEmitted when a gutter is added.
var gutterClicked: Signal2Emitted when a gutter is clicked.
var gutterRemoved: SimpleSignalEmitted when a gutter is removed.
var highlightAllOccurrences: BoolIf true, all occurrences of the selected text will be highlighted.
var highlightCurrentLine: BoolIf true, the line containing the cursor is highlighted.
var indentWrappedLines: BoolIf true, all wrapped lines are indented to the same amount as the unwrapped line.
var language: StringLanguage code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
var linesEditedFrom: Signal1Emitted immediately when the text changes.
var middleMousePasteEnabled: BoolIf false, using middle mouse button to paste clipboard will be disabled.
var minimapDraw: BoolIf true, a minimap is shown, providing an outline of your source code. The minimap uses a fixed-width text size.
var minimapWidth: Int32The width, in pixels, of the minimap.
var placeholderText: StringText shown when the TextEdit is empty. It is not the TextEdit’s default value (see text).
var scrollFitContentHeight: BoolIf true, TextEdit will disable vertical scroll and fit minimum height to the number of visible lines.
var scrollHorizontal: Int32If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels.
var scrollPastEndOfFile: BoolAllow scrolling past the last line into “virtual” space.
var scrollSmooth: BoolScroll smoothly over the text rather than jumping to the next location.
var scrollVScrollSpeed: DoubleSets the scroll speed with the minimap or when scrollSmooth is enabled.
var scrollVertical: DoubleIf there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line.
var selectingEnabled: BoolIf true, text can be selected.
var shortcutKeysEnabled: BoolIf true, shortcut keys for context menu items are enabled, even if the context menu is disabled.
var structuredTextBidiOverride: TextServer.StructuredTextParserSet BiDi algorithm override for the structured text.
var structuredTextBidiOverrideOptions: GArraySet additional options for BiDi override.
var syntaxHighlighter: SyntaxHighlighter?Sets the SyntaxHighlighter to use.
var text: StringString value of the TextEdit.
var textChanged: SimpleSignalEmitted when the text changes.
var textDirection: Control.TextDirectionBase text writing direction.
var textSet: SimpleSignalEmitted when clear is called or text is set.
var virtualKeyboardEnabled: BoolIf true, the native virtual keyboard is shown when focused on platforms that support it.
var wrapMode: TextEdit.LineWrappingModeSets the line wrapping mode to use.
func addCaret(line: Int32, column: Int32) -> Int32Adds a new caret at the given location. Returns the index of the new caret, or -1 if the location is invalid.
func addCaretAtCarets(below: Bool)Adds an additional caret above or below every caret. If below is true the new caret will be added below and above otherwise.
func addGutter(at: Int32)Register a new gutter to this TextEdit. Use at to have a specific gutter order. A value of -1 appends the gutter to the right.
func addSelectionForNextOccurrence()Adds a selection and a caret for the next occurrence of the current selection. If there is no active selection, selects word under caret.
func adjustCaretsAfterEdit(caret: Int32, fromLine: Int32, fromCol: Int32, toLine: Int32, toCol: Int32)This method does nothing.
func adjustViewportToCaret(caretIndex: Int32)Adjust the viewport so the caret is visible.
func applyIme()Applies text from the Input Method Editor (IME) to each caret and closes the IME if it is open.
func backspace(caretIndex: Int32)Called when the user presses the backspace key. Can be overridden with _backspace(caretIndex:).
func beginComplexOperation()Starts a multipart edit. All edits will be treated as one action until endComplexOperation is called.
func beginMulticaretEdit()Starts an edit for multiple carets. The edit must be ended with endMulticaretEdit. 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. beginMulticaretEdit and endMulticaretEdit can be nested, and the merge will happen at the last endMulticaretEdit.
func cancelIme()Closes the Input Method Editor (IME) if it is open. Any text in the IME will be lost.
func centerViewportToCaret(caretIndex: Int32)Centers the viewport on the line the editing caret is at. This also resets the scrollHorizontal value to 0.
func clear()Performs a full reset of TextEdit, including undo history.
func clearUndoHistory()Clears the undo history.
func collapseCarets(fromLine: Int32, fromColumn: Int32, toLine: Int32, toColumn: Int32, inclusive: Bool)Collapse all carets in the given range to the fromLine and fromColumn position.
func copy(caretIndex: Int32)Copies the current text selection. Can be overridden with _copy(caretIndex:).
func cut(caretIndex: Int32)Cut’s the current selection. Can be overridden with _cut(caretIndex:).
func deleteSelection(caretIndex: Int32)Deletes the selected text.
func deselect(caretIndex: Int32)Deselects the current selection.
func endAction()Marks the end of steps in the current action started with startAction(_:).
func endComplexOperation()Ends a multipart edit, started with beginComplexOperation. If called outside a complex operation, the current operation is pushed onto the undo/redo stack.
func endMulticaretEdit()Ends an edit for multiple carets, that was started with beginMulticaretEdit. If this was the last endMulticaretEdit and mergeOverlappingCarets was called, carets will be merged.
func getCaretColumn(caretIndex: Int32) -> Int32Returns the column the editing caret is at.
func getCaretCount() -> Int32Returns the number of carets in this TextEdit.
func getCaretDrawPos(caretIndex: Int32) -> Vector2Returns the caret pixel draw position.
func getCaretIndexEditOrder() -> PackedInt32ArrayReturns a list of caret indexes in their edit order, this done from bottom to top. Edit order refers to the way actions such as insertTextAtCaret(text:caretIndex:) are applied.
func getCaretLine(caretIndex: Int32) -> Int32Returns the line the editing caret is on.
func getCaretWrapIndex(caretIndex: Int32) -> Int32Returns the wrap index the editing caret is on.
func getFirstNonWhitespaceColumn(line: Int32) -> Int32Returns the first column containing a non-whitespace character.
func getFirstVisibleLine() -> Int32Returns the first visible line.
func getGutterCount() -> Int32Returns the number of gutters registered.
func getGutterType(gutter: Int32) -> TextEdit.GutterTypeReturns the type of the gutter at the given index. Gutters can contain icons, text, or custom visuals. See TextEdit.GutterType for options.
func getGutterWidth(gutter: Int32) -> Int32Returns the width of the gutter at the given index.
func getHScrollBar() -> HScrollBar?Returns the HScrollBar used by TextEdit.
func getIndentLevel(line: Int32) -> Int32Returns the number of spaces and tab * tab_size before the first char.
func getLastFullVisibleLine() -> Int32Returns the last visible line. Use getLastFullVisibleLineWrapIndex for the wrap index.
func getLastFullVisibleLineWrapIndex() -> Int32Returns the last visible wrap index of the last visible line.
func getLastUnhiddenLine() -> Int32Returns the last unhidden line in the entire TextEdit.
func getLine(Int32) -> StringReturns the text of a specific line.
func getLineBackgroundColor(line: Int32) -> ColorReturns the current background color of the line. Color(0, 0, 0, 0) is returned if no color is set.
func getLineColumnAtPos(position: Vector2i, allowOutOfBounds: Bool) -> Vector2iReturns the line and column at the given position. In the returned vector, x is the column, y is the line. If allowOutOfBounds is false and the position is not over the text, both vector values will be set to -1.
func getLineCount() -> Int32Returns the number of lines in the text.
func getLineGutterIcon(line: Int32, gutter: Int32) -> Texture2D?Returns the icon currently in gutter at line. This only works when the gutter type is .icon (see setGutterType(gutter:type:)).
func getLineGutterItemColor(line: Int32, gutter: Int32) -> ColorReturns the color currently in gutter at line.
func getLineGutterMetadata(line: Int32, gutter: Int32) -> VariantReturns the metadata currently in gutter at line.
func getLineHeight() -> Int32Returns the maximum value of the line height among all lines.
func getLineRangesFromCarets(onlySelections: Bool, mergeAdjacent: Bool) -> VariantCollection<Vector2i>Returns an GArray of line ranges where x is the first line and y 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.
func getLineWidth(line: Int32, wrapIndex: Int32) -> Int32Returns the width in pixels of the wrapIndex on line.
func getLineWrapCount(line: Int32) -> Int32Returns the number of times the given line is wrapped.
func getLineWrapIndexAtColumn(line: Int32, column: Int32) -> Int32Returns the wrap index of the given line column.
func getLineWrappedText(line: Int32) -> PackedStringArrayReturns an array of Strings representing each wrapped index.
func getLocalMousePos() -> Vector2Returns the local mouse position adjusted for the text direction.
func getMinimapLineAtPos(position: Vector2i) -> Int32Returns the equivalent minimap line at position.
func getMinimapVisibleLines() -> Int32Returns the number of lines that may be drawn on the minimap.
func getNextVisibleLineIndexOffsetFrom(line: Int32, wrapIndex: Int32, visibleAmount: Int32) -> Vector2iSimilar to getNextVisibleLineOffsetFrom(line:visibleAmount:), but takes into account the line wrap indexes. In the returned vector, x is the line, y is the wrap index.
func getNextVisibleLineOffsetFrom(line: Int32, visibleAmount: Int32) -> Int32Returns the count to the next visible line from line to line + visible_amount. Can also count backwards. For example if a TextEdit has 5 lines with lines 2 and 3 hidden, calling this with line = 1, visible_amount = 1 would return 3.
func getPosAtLineColumn(line: Int32, column: Int32) -> Vector2iReturns 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.
func getRectAtLineColumn(line: Int32, column: Int32) -> Rect2iReturns 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.
func getSavedVersion() -> UInt32Returns the last tagged saved version from tagSavedVersion.
func getScrollPosForLine(Int32, wrapIndex: Int32) -> DoubleReturns the scroll position for wrapIndex of line.
func getSelectedText(caretIndex: Int32) -> StringReturns the text inside the selection of a caret, or all the carets if caretIndex is its default value -1.
func getSelectionAtLineColumn(line: Int32, column: Int32, includeEdges: Bool, onlySelections: Bool) -> Int32Returns the caret index of the selection at the given line and column, or -1 if there is none.
func getSelectionColumn(caretIndex: Int32) -> Int32Returns the original start column of the selection.
func getSelectionFromColumn(caretIndex: Int32) -> Int32Returns the selection begin column. Returns the caret column if there is no selection.
func getSelectionFromLine(caretIndex: Int32) -> Int32Returns the selection begin line. Returns the caret line if there is no selection.
func getSelectionLine(caretIndex: Int32) -> Int32Returns the original start line of the selection.
func getSelectionMode() -> TextEdit.SelectionModeReturns the current selection mode.
func getSelectionOriginColumn(caretIndex: Int32) -> Int32Returns the origin column of the selection. This is the opposite end from the caret.
func getSelectionOriginLine(caretIndex: Int32) -> Int32Returns the origin line of the selection. This is the opposite end from the caret.
func getSelectionToColumn(caretIndex: Int32) -> Int32Returns the selection end column. Returns the caret column if there is no selection.
func getSelectionToLine(caretIndex: Int32) -> Int32Returns the selection end line. Returns the caret line if there is no selection.
func getSortedCarets(includeIgnoredCarets: Bool) -> PackedInt32ArrayReturns the carets sorted by selection beginning from lowest line and column to highest (from top to bottom of text).
func getTabSize() -> Int32Returns the TextEdit‘s’ tab size.
func getTotalGutterWidth() -> Int32Returns the total width of all gutters and internal padding.
func getTotalVisibleLineCount() -> Int32Returns the number of lines that may be drawn.
func getVScrollBar() -> VScrollBar?Returns the VScrollBar of the TextEdit.
func getVersion() -> UInt32Returns the current version of the TextEdit. The version is a count of recorded operations by the undo/redo history.
func getVisibleLineCount() -> Int32Returns the number of visible lines, including wrapped text.
func getVisibleLineCountInRange(fromLine: Int32, toLine: Int32) -> Int32Returns the total number of visible + wrapped lines between the two lines.
func getWordAtPos(position: Vector2) -> StringReturns the word at position.
func getWordUnderCaret(caretIndex: Int32) -> StringReturns a String text with the word under the caret’s location.
func hasImeText() -> BoolReturns true if the user has text in the Input Method Editor (IME).
func hasRedo() -> BoolReturns true if a “redo” action is available.
func hasSelection(caretIndex: Int32) -> BoolReturns true if the user has selected text.
func hasUndo() -> BoolReturns true if an “undo” action is available.
func insertLineAt(line: Int32, text: String)Inserts a new line with text at line.
func insertText(String, line: Int32, column: Int32, beforeSelectionBegin: Bool, beforeSelectionEnd: Bool)Inserts the text at line and column.
func insertTextAtCaret(text: String, caretIndex: Int32)Insert the specified text at the caret position.
func isCaretAfterSelectionOrigin(caretIndex: Int32) -> BoolReturns true if the caret of the selection is after the selection origin. This can be used to determine the direction of the selection.
func isCaretVisible(caretIndex: Int32) -> BoolReturns true if the caret is visible on the screen.
func isDraggingCursor() -> BoolReturns true if the user is dragging their mouse for scrolling, selecting, or text dragging.
func isGutterClickable(gutter: Int32) -> BoolReturns whether the gutter is clickable.
func isGutterDrawn(gutter: Int32) -> BoolReturns whether the gutter is currently drawn.
func isGutterOverwritable(gutter: Int32) -> BoolReturns whether the gutter is overwritable.
func isInMulitcaretEdit() -> BoolReturns true if a beginMulticaretEdit has been called and endMulticaretEdit has not yet been called.
func isLineGutterClickable(line: Int32, gutter: Int32) -> BoolReturns whether the gutter on the given line is clickable.
func isLineWrapped(line: Int32) -> BoolReturns if the given line is wrapped.
func isMouseOverSelection(edges: Bool, caretIndex: Int32) -> BoolReturns whether the mouse is over selection. If edges is true, the edges are considered part of the selection.
func isOvertypeModeEnabled() -> BoolReturns whether the user is in overtype mode.
func mergeGutters(fromLine: Int32, toLine: Int32)Merge the gutters from fromLine into toLine. Only overwritable gutters will be copied.
func mergeOverlappingCarets()Merges any overlapping carets. Will favor the newest caret, or the caret with a selection.
func multicaretEditIgnoreCaret(caretIndex: Int32) -> BoolReturns true if the given caretIndex should be ignored as part of a multicaret edit. See beginMulticaretEdit and endMulticaretEdit. 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.
func paste(caretIndex: Int32)Paste at the current location. Can be overridden with _paste(caretIndex:).
func pastePrimaryClipboard(caretIndex: Int32)Pastes the primary clipboard.
func redo()Perform redo operation.
func removeCaret(Int32)Removes the given caret index.
func removeGutter(Int32)Removes the gutter from this TextEdit.
func removeLineAt(line: Int32, moveCaretsDown: Bool)Removes the line of text at line. Carets on this line will attempt to match their previous visual x position.
func removeSecondaryCarets()Removes all additional carets.
func removeText(fromLine: Int32, fromColumn: Int32, toLine: Int32, toColumn: Int32)Removes text between the given positions.
func search(text: String, flags: UInt32, fromLine: Int32, fromColumn: Int32) -> Vector2iPerform a search inside the text. Search flags can be specified in the SearchFlags enum.
func select(originLine: Int32, originColumn: Int32, caretLine: Int32, caretColumn: Int32, caretIndex: Int32)Selects text from originLine and originColumn to caretLine and caretColumn for the given caretIndex. This moves the selection origin and the caret. If the positions are the same, the selection will be deselected.
func selectAll()Select all the text.
func selectWordUnderCaret(caretIndex: Int32)Selects the word under the caret.
func setCaretColumn(Int32, adjustViewport: Bool, caretIndex: Int32)Moves the caret to the specified column index.
func setCaretLine(Int32, adjustViewport: Bool, canBeHidden: Bool, wrapIndex: Int32, caretIndex: Int32)Moves the caret to the specified line index. The caret column will be moved to the same visual position it was at the last time setCaretColumn(_:adjustViewport:caretIndex:) was called, or clamped to the end of the line.
func setGutterClickable(gutter: Int32, clickable: Bool)Sets the gutter as clickable. This will change the mouse cursor to a pointing hand when hovering over the gutter.
func setGutterCustomDraw(column: Int32, drawCallback: Callable)Set a custom draw method for the gutter. The callback method must take the following args: line: int, gutter: int, Area: Rect2. This only works when the gutter type is .custom (see setGutterType(gutter:type:)).
func setGutterDraw(gutter: Int32, draw: Bool)Sets whether the gutter should be drawn.
func setGutterName(gutter: Int32, name: String)Sets the name of the gutter.
func setGutterOverwritable(gutter: Int32, overwritable: Bool)Sets the gutter to overwritable. See mergeGutters(fromLine:toLine:).
func setGutterType(gutter: Int32, type: TextEdit.GutterType)Sets the type of gutter. Gutters can contain icons, text, or custom visuals. See TextEdit.GutterType for options.
func setGutterWidth(gutter: Int32, width: Int32)Set the width of the gutter.
func setLine(Int32, newText: String)Sets the text for a specific line.
func setLineAsCenterVisible(line: Int32, wrapIndex: Int32)Positions the wrapIndex of line at the center of the viewport.
func setLineAsFirstVisible(line: Int32, wrapIndex: Int32)Positions the wrapIndex of line at the top of the viewport.
func setLineAsLastVisible(line: Int32, wrapIndex: Int32)Positions the wrapIndex of line at the bottom of the viewport.
func setLineBackgroundColor(line: Int32, color: Color)Sets the current background color of the line. Set to Color(0, 0, 0, 0) for no color.
func setLineGutterClickable(line: Int32, gutter: Int32, clickable: Bool)If clickable is true, makes the gutter on line clickable. See [signal gutter_clicked].
func setLineGutterIcon(line: Int32, gutter: Int32, icon: Texture2D?)Sets the icon for gutter on line to icon. This only works when the gutter type is .icon (see setGutterType(gutter:type:)).
func setLineGutterItemColor(line: Int32, gutter: Int32, color: Color)Sets the color for gutter on line to color.
func setLineGutterMetadata(line: Int32, gutter: Int32, metadata: Variant)Sets the metadata for gutter on line to metadata.
func setLineGutterText(line: Int32, gutter: Int32, text: String)Sets the text for gutter on line to text. This only works when the gutter type is .string (see setGutterType(gutter:type:)).
func setOvertypeModeEnabled(Bool)If true, sets the user into overtype mode. When the user types in this mode, it will override existing text.
func setSearchFlags(UInt32)Sets the search flags. This is used with setSearchText(_:) to highlight occurrences of the searched text. Search flags can be specified from the SearchFlags enum.
func setSearchText(String)Sets the search text. See setSearchFlags(_:).
func setSelectionMode(TextEdit.SelectionMode)Sets the current selection mode.
func setSelectionOriginColumn(Int32, caretIndex: Int32)Sets the selection origin column to the column for the given caretIndex. If the selection origin is moved to the caret position, the selection will deselect.
func setSelectionOriginLine(Int32, canBeHidden: Bool, wrapIndex: Int32, caretIndex: Int32)Sets the selection origin line to the line for the given caretIndex. If the selection origin is moved to the caret position, the selection will deselect.
func setTabSize(Int32)Sets the tab size for the TextEdit to use.
func setTooltipRequestFunc(callback: Callable)Provide custom tooltip text. The callback method must take the following args: hovered_word: String.
func skipSelectionForNextOccurrence()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.
func startAction(TextEdit.EditAction)Starts an action, will end the current action if action is different.
func swapLines(fromLine: Int32, toLine: Int32)Swaps the two lines. Carets will be swapped with the lines.
func tagSavedVersion()Tag the current version as saved.
func undo()Perform undo operation.