Multiline text editing control.
    public class TextEdit : 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.

Inheritance Chain


    public TextEdit()


    "breakpoint_toggled" (int row)

Emitted when a breakpoint is placed via the breakpoint gutter.

    "cursor_changed" ()

Emitted when the cursor changes.

    "request_completion" ()

    "symbol_lookup" (String symbol, int row, int column)

    "text_changed" ()

Emitted when the text changes.


    public bool BreakpointGutter { get; set; }

If true, the breakpoint gutter is visible.

    public bool CaretBlink { get; set; }

If true, the caret (visual cursor) blinks.

    public float CaretBlinkSpeed { get; set; }

Duration (in seconds) of a caret’s blinking cycle.

    public bool CaretBlockMode { get; set; }

If true, the caret displays as a rectangle.

If false, the caret displays as a bar.

    public bool CaretMovingByRightClick { get; set; }

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.

    public bool ContextMenuEnabled { get; set; }

If true, a right click displays the context menu.

    public int HidingEnabled { get; set; }

    public bool HighlightAllOccurrences { get; set; }

    public bool HighlightCurrentLine { get; set; }

If true, the line containing the cursor is highlighted.

    public bool OverrideSelectedFontColor { get; set; }

    public bool Readonly { get; set; }

If true, read-only mode is enabled. Existing text cannot be modified and new text cannot be added.

    public bool ShowLineNumbers { get; set; }

If true, line numbers are displayed to the left of the text.

    public bool SmoothScrolling { get; set; }

    public bool SyntaxHighlighting { get; set; }

    public string Text { get; set; }

String value of the TextEdit.

    public float VScrollSpeed { get; set; }

If true, enables text wrapping when it goes beyond he edge of what is visible.

    public bool WrapEnabled { get; set; }


    public void AddColorRegion(string beginKey, string endKey, Color color, bool lineOnly = false)

Add color region (given the delimiters) and its colors.

    public void AddKeywordColor(string keyword, Color color)

Add a keyword and its color.

    public bool CanFold(int line)

    public void ClearColors()

Clear all the syntax coloring information.

    public void ClearUndoHistory()

Clear the undo history.

    public void Copy()

Copy the current selection.

    public bool CursorGetBlinkEnabled()

Getter for CaretBlink

    public float CursorGetBlinkSpeed()

Getter for CaretBlinkSpeed

    public int CursorGetColumn()

Return the column the editing cursor is at.

    public int CursorGetLine()

Return the line the editing cursor is at.

    public bool CursorIsBlockMode()

Getter for CaretBlockMode

    public void CursorSetBlinkEnabled(bool enable)

Setter for CaretBlink

    public void CursorSetBlinkSpeed(float blinkSpeed)

Setter for CaretBlinkSpeed

    public void CursorSetBlockMode(bool enable)

Setter for CaretBlockMode

    public void CursorSetColumn(int column, bool adjustViewport = true)

    public void CursorSetLine(int line, bool adjustViewport = true, bool canBeHidden = true, int wrapIndex = 0)

    public void Cut()

Cut the current selection.

    public void Deselect()

Clears the current selection.

    public void FoldAllLines()

    public void FoldLine(int line)

    public Godot.Collections.Array GetBreakpoints()

Return an array containing the line number of each breakpoint.

    public Color GetKeywordColor(string keyword)

    public string GetLine(int line)

Return the text of a specific line.

    public int GetLineCount()

Return the amount of total lines in the text.

    public PopupMenu GetMenu()

    public int GetSelectionFromColumn()

Return the selection begin column.

    public int GetSelectionFromLine()

Return the selection begin line.

    public string GetSelectionText()

Return the text inside the selection.

    public int GetSelectionToColumn()

Return the selection end column.

    public int GetSelectionToLine()

Return the selection end line.

    public string GetText()

Getter for Text

    public float GetVScrollSpeed()

Getter for VScrollSpeed

    public string GetWordUnderCursor()

    public bool HasKeywordColor(string keyword)

    public void InsertTextAtCursor(string text)

Insert a given text at the cursor position.

    public bool IsBreakpointGutterEnabled()

Getter for BreakpointGutter

    public bool IsContextMenuEnabled()

Getter for ContextMenuEnabled

    public bool IsFolded(int line)

    public int IsHidingEnabled()

Getter for HidingEnabled

    public bool IsHighlightAllOccurrencesEnabled()

Getter for HighlightAllOccurrences

    public bool IsHighlightCurrentLineEnabled()

Getter for HighlightCurrentLine

    public bool IsLineHidden(int line)

    public bool IsOverridingSelectedFontColor()

Getter for OverrideSelectedFontColor

    public bool IsReadonly()

Getter for Readonly

    public bool IsRightClickMovingCaret()

Getter for CaretMovingByRightClick

    public bool IsSelectionActive()

Return true if the selection is active.

    public bool IsShowLineNumbersEnabled()

Getter for ShowLineNumbers

    public bool IsSmoothScrollEnabled()

Getter for SmoothScrolling

    public bool IsSyntaxColoringEnabled()

Getter for SyntaxHighlighting

    public bool IsWrapEnabled()

Getter for WrapEnabled

    public void MenuOption(int option)

    public void Paste()

Paste the current selection.

    public void Redo()

Perform redo operation.

    public void RemoveBreakpoints()

Removes all the breakpoints (without firing “breakpoint_toggled” signal).

    public int[] Search(string key, int flags, int fromLine, int fromColumn)

Perform a search inside the text. Search flags can be specified in the SEARCH_* enum.

    public void Select(int fromLine, int fromColumn, int toLine, int toColumn)

Perform selection, from line/column to line/column.

    public void SelectAll()

Select all the text.

    public void SetBreakpointGutterEnabled(bool enable)

Setter for BreakpointGutter

    public void SetContextMenuEnabled(bool enable)

Setter for ContextMenuEnabled

    public void SetHidingEnabled(int enable)

Setter for HidingEnabled

    public void SetHighlightAllOccurrences(bool enable)

Setter for HighlightAllOccurrences

    public void SetHighlightCurrentLine(bool enabled)

Setter for HighlightCurrentLine

    public void SetLineAsHidden(int line, bool enable)

    public void SetOverrideSelectedFontColor(bool @override)

Setter for OverrideSelectedFontColor

    public void SetReadonly(bool enable)

Setter for Readonly

    public void SetRightClickMovesCaret(bool enable)

Setter for CaretMovingByRightClick

    public void SetShowLineNumbers(bool enable)

Setter for ShowLineNumbers

    public void SetSmoothScrollEnable(bool enable)

Setter for SmoothScrolling

    public void SetSyntaxColoring(bool enable)

Setter for SyntaxHighlighting

    public void SetText(string text)

Setter for Text

    public void SetVScrollSpeed(float speed)

Setter for VScrollSpeed

    public void SetWrapEnabled(bool enable)

Setter for WrapEnabled

    public void ToggleFoldLine(int line)

Toggle the folding of the code block at the given line.

    public void Undo()

Perform undo operation.

    public void UnfoldLine(int line)

    public void UnhideAllLines()

Inner Types

Name Value Description
Cut 0 Cuts (Copies and clears) the selected text.
Copy 1 Copies the selected text.
Paste 2 Pastes the clipboard text over the selected text (or at the cursor’s position).
Clear 3 Erases the whole [TextEdit] text.
SelectAll 4 Selects the whole [TextEdit] text.
Undo 5 Undoes the previous action.
Redo 6  
Max 7  


Name Value Description
MatchCase 1 Match case when searching.
WholeWords 2 Match whole words when searching.
Backwards 4 Search from end to beginning.