Documentation
¶
Overview ¶
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.
While entering text, it is possible to insert special characters using Unicode, OEM or Windows alt codes:
- To enter Unicode codepoints, hold Alt and type the codepoint on the numpad. For example, to enter the character á (U+00E1), hold Alt and type +E1 on the numpad (the leading zeroes can be omitted).
- To enter OEM codepoints, hold Alt and type the code on the numpad. For example, to enter the character á (OEM 160), hold Alt and type 160 on the numpad.
- To enter Windows codepoints, hold Alt and type the code on the numpad. For example, to enter the character á (Windows 0225), hold Alt and type 0, 2, 2, 5 on the numpad. The leading zero here must not be omitted, as this is how Windows codepoints are distinguished from OEM codepoints.
Note: Most viewport, caret, and edit methods contain a caret_index argument for CaretMultiple support. The argument should be one of the following: -1 for all carets, 0 for the main caret, or greater than 0 for secondary carets in the order they were created.
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.
Index ¶
- type Advanced
- type Any
- type CaretType
- type EditAction
- type Expanded
- type Extension
- type GutterType
- type ID
- type Implementation
- type Instance
- func (self Instance) AddCaret(line int, column int) int
- func (self Instance) AddCaretAtCarets(below bool)
- func (self Instance) AddGutter()
- func (self Instance) AddSelectionForNextOccurrence()
- func (self Instance) AdjustCaretsAfterEdit(caret int, from_line int, from_col int, to_line int, to_col int)
- func (self Instance) AdjustViewportToCaret()
- func (self Instance) ApplyIme()
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsControl() Control.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsTextEdit() Instance
- func (self Instance) AutowrapMode() TextServer.AutowrapMode
- func (self Instance) Backspace()
- func (self Instance) BackspaceDeletesCompositeCharacterEnabled() bool
- func (self Instance) BeginComplexOperation()
- func (self Instance) BeginMulticaretEdit()
- func (self Instance) CancelIme()
- func (self Instance) CaretBlink() bool
- func (self Instance) CaretBlinkInterval() Float.X
- func (self Instance) CaretDrawWhenEditableDisabled() bool
- func (self Instance) CaretMidGrapheme() bool
- func (self Instance) CaretMoveOnRightClick() bool
- func (self Instance) CaretMultiple() bool
- func (self Instance) CaretType() CaretType
- func (self Instance) CenterViewportToCaret()
- func (self Instance) Clear()
- func (self Instance) ClearUndoHistory()
- func (self Instance) CollapseCarets(from_line int, from_column int, to_line int, to_column int)
- func (self Instance) ContextMenuEnabled() bool
- func (self Instance) Copy()
- func (self Instance) CustomWordSeparators() string
- func (self Instance) Cut()
- func (self Instance) DeleteSelection()
- func (self Instance) Deselect()
- func (self Instance) DeselectOnFocusLossEnabled() bool
- func (self Instance) DragAndDropSelectionEnabled() bool
- func (self Instance) DrawControlChars() bool
- func (self Instance) DrawSpaces() bool
- func (self Instance) DrawTabs() bool
- func (self Instance) Editable() bool
- func (self Instance) EmojiMenuEnabled() bool
- func (self Instance) EmptySelectionClipboardEnabled() bool
- func (self Instance) EndAction()
- func (self Instance) EndComplexOperation()
- func (self Instance) EndMulticaretEdit()
- func (self Instance) GetCaretColumn() int
- func (self Instance) GetCaretCount() int
- func (self Instance) GetCaretDrawPos() Vector2.XY
- func (self Instance) GetCaretIndexEditOrder() []int32
- func (self Instance) GetCaretLine() int
- func (self Instance) GetCaretWrapIndex() int
- func (self Instance) GetFirstNonWhitespaceColumn(line int) int
- func (self Instance) GetFirstVisibleLine() int
- func (self Instance) GetGutterCount() int
- func (self Instance) GetGutterName(gutter int) string
- func (self Instance) GetGutterType(gutter int) GutterType
- func (self Instance) GetGutterWidth(gutter int) int
- func (self Instance) GetHScrollBar() HScrollBar.Instance
- func (self Instance) GetIndentLevel(line int) int
- func (self Instance) GetLastFullVisibleLine() int
- func (self Instance) GetLastFullVisibleLineWrapIndex() int
- func (self Instance) GetLastUnhiddenLine() int
- func (self Instance) GetLine(line int) string
- func (self Instance) GetLineBackgroundColor(line int) Color.RGBA
- func (self Instance) GetLineColumnAtPos(position Vector2i.XY) Vector2i.XY
- func (self Instance) GetLineCount() int
- func (self Instance) GetLineGutterIcon(line int, gutter int) Texture2D.Instance
- func (self Instance) GetLineGutterItemColor(line int, gutter int) Color.RGBA
- func (self Instance) GetLineGutterMetadata(line int, gutter int) any
- func (self Instance) GetLineGutterText(line int, gutter int) string
- func (self Instance) GetLineHeight() int
- func (self Instance) GetLineRangesFromCarets() []Vector2i.XY
- func (self Instance) GetLineWidth(line int) int
- func (self Instance) GetLineWithIme(line int) string
- func (self Instance) GetLineWrapCount(line int) int
- func (self Instance) GetLineWrapIndexAtColumn(line int, column int) int
- func (self Instance) GetLineWrappedText(line int) []string
- func (self Instance) GetLocalMousePos() Vector2.XY
- func (self Instance) GetMenu() PopupMenu.Instance
- func (self Instance) GetMinimapLineAtPos(position Vector2i.XY) int
- func (self Instance) GetMinimapVisibleLines() int
- func (self Instance) GetNextCompositeCharacterColumn(line int, column int) int
- func (self Instance) GetNextVisibleLineIndexOffsetFrom(line int, wrap_index int, visible_amount int) Vector2i.XY
- func (self Instance) GetNextVisibleLineOffsetFrom(line int, visible_amount int) int
- func (self Instance) GetPosAtLineColumn(line int, column int) Vector2i.XY
- func (self Instance) GetPreviousCompositeCharacterColumn(line int, column int) int
- func (self Instance) GetRectAtLineColumn(line int, column int) Rect2i.PositionSize
- func (self Instance) GetSavedVersion() int
- func (self Instance) GetScrollPosForLine(line int) Float.X
- func (self Instance) GetSelectedText() string
- func (self Instance) GetSelectionAtLineColumn(line int, column int) int
- func (self Instance) GetSelectionColumn() int
- func (self Instance) GetSelectionFromColumn() int
- func (self Instance) GetSelectionFromLine() int
- func (self Instance) GetSelectionLine() int
- func (self Instance) GetSelectionMode() SelectionMode
- func (self Instance) GetSelectionOriginColumn() int
- func (self Instance) GetSelectionOriginLine() int
- func (self Instance) GetSelectionToColumn() int
- func (self Instance) GetSelectionToLine() int
- func (self Instance) GetSortedCarets() []int32
- func (self Instance) GetTabSize() int
- func (self Instance) GetTotalGutterWidth() int
- func (self Instance) GetTotalVisibleLineCount() int
- func (self Instance) GetVScrollBar() VScrollBar.Instance
- func (self Instance) GetVersion() int
- func (self Instance) GetVisibleLineCount() int
- func (self Instance) GetVisibleLineCountInRange(from_line int, to_line int) int
- func (self Instance) GetWordAtPos(position Vector2.XY) string
- func (self Instance) GetWordUnderCaret() string
- func (self Instance) HasImeText() bool
- func (self Instance) HasRedo() bool
- func (self Instance) HasSelection() bool
- func (self Instance) HasUndo() bool
- func (self Instance) HighlightAllOccurrences() bool
- func (self Instance) HighlightCurrentLine() bool
- func (self Instance) ID() ID
- func (self Instance) IndentWrappedLines() bool
- func (self Instance) InsertLineAt(line int, text string)
- func (self Instance) InsertText(text string, line int, column int)
- func (self Instance) InsertTextAtCaret(text string)
- func (self Instance) IsCaretAfterSelectionOrigin() bool
- func (self Instance) IsCaretVisible() bool
- func (self Instance) IsDraggingCursor() bool
- func (self Instance) IsGutterClickable(gutter int) bool
- func (self Instance) IsGutterDrawn(gutter int) bool
- func (self Instance) IsGutterOverwritable(gutter int) bool
- func (self Instance) IsInMulitcaretEdit() bool
- func (self Instance) IsLineGutterClickable(line int, gutter int) bool
- func (self Instance) IsLineWrapped(line int) bool
- func (self Instance) IsMenuVisible() bool
- func (self Instance) IsMouseOverSelection(edges bool) bool
- func (self Instance) IsOvertypeModeEnabled() bool
- func (self Instance) Language() string
- func (self Instance) MenuOption(option int)
- func (self Instance) MergeGutters(from_line int, to_line int)
- func (self Instance) MergeOverlappingCarets()
- func (self Instance) MiddleMousePasteEnabled() bool
- func (self Instance) MinimapDraw() bool
- func (self Instance) MinimapWidth() int
- func (self Instance) MoreArgs() MoreArgs
- func (self Instance) MulticaretEditIgnoreCaret(caret_index int) bool
- func (self Instance) OnCaretChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) OnGutterAdded(cb func(), flags ...Signal.Flags)
- func (self Instance) OnGutterClicked(cb func(line int, gutter int), flags ...Signal.Flags)
- func (self Instance) OnGutterRemoved(cb func(), flags ...Signal.Flags)
- func (self Instance) OnLinesEditedFrom(cb func(from_line int, to_line int), flags ...Signal.Flags)
- func (self Instance) OnTextChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) OnTextSet(cb func(), flags ...Signal.Flags)
- func (self Instance) Paste()
- func (self Instance) PastePrimaryClipboard()
- func (self Instance) PlaceholderText() string
- func (self Instance) Redo()
- func (self Instance) RemoveCaret(caret int)
- func (self Instance) RemoveGutter(gutter int)
- func (self Instance) RemoveLineAt(line int)
- func (self Instance) RemoveSecondaryCarets()
- func (self Instance) RemoveText(from_line int, from_column int, to_line int, to_column int)
- func (self Instance) ScrollFitContentHeight() bool
- func (self Instance) ScrollFitContentWidth() bool
- func (self Instance) ScrollHorizontal() int
- func (self Instance) ScrollPastEndOfFile() bool
- func (self Instance) ScrollSmooth() bool
- func (self Instance) ScrollVScrollSpeed() Float.X
- func (self Instance) ScrollVertical() Float.X
- func (self Instance) Search(text string, flags SearchFlags, from_line int, from_column int) (int, int)
- func (self Instance) Select(origin_line int, origin_column int, caret_line int, caret_column int)
- func (self Instance) SelectAll()
- func (self Instance) SelectWordUnderCaret()
- func (self Instance) SelectingEnabled() bool
- func (self Instance) SetAutowrapMode(value TextServer.AutowrapMode)
- func (self Instance) SetBackspaceDeletesCompositeCharacterEnabled(value bool)
- func (self Instance) SetCaretBlink(value bool)
- func (self Instance) SetCaretBlinkInterval(value Float.X)
- func (self Instance) SetCaretColumn(column int)
- func (self Instance) SetCaretDrawWhenEditableDisabled(value bool)
- func (self Instance) SetCaretLine(line int)
- func (self Instance) SetCaretMidGrapheme(value bool)
- func (self Instance) SetCaretMoveOnRightClick(value bool)
- func (self Instance) SetCaretMultiple(value bool)
- func (self Instance) SetCaretType(value CaretType)
- func (self Instance) SetContextMenuEnabled(value bool)
- func (self Instance) SetCustomWordSeparators(value string)
- func (self Instance) SetDeselectOnFocusLossEnabled(value bool)
- func (self Instance) SetDragAndDropSelectionEnabled(value bool)
- func (self Instance) SetDrawControlChars(value bool)
- func (self Instance) SetDrawSpaces(value bool)
- func (self Instance) SetDrawTabs(value bool)
- func (self Instance) SetEditable(value bool)
- func (self Instance) SetEmojiMenuEnabled(value bool)
- func (self Instance) SetEmptySelectionClipboardEnabled(value bool)
- func (self Instance) SetGutterClickable(gutter int, clickable bool)
- func (self Instance) SetGutterCustomDraw(column int, draw_callback func(line int, gutter int, area Rect2.PositionSize))
- func (self Instance) SetGutterDraw(gutter int, draw bool)
- func (self Instance) SetGutterName(gutter int, name string)
- func (self Instance) SetGutterOverwritable(gutter int, overwritable bool)
- func (self Instance) SetGutterType(gutter int, atype GutterType)
- func (self Instance) SetGutterWidth(gutter int, width int)
- func (self Instance) SetHighlightAllOccurrences(value bool)
- func (self Instance) SetHighlightCurrentLine(value bool)
- func (self Instance) SetIndentWrappedLines(value bool)
- func (self Instance) SetLanguage(value string)
- func (self Instance) SetLine(line int, new_text string)
- func (self Instance) SetLineAsCenterVisible(line int)
- func (self Instance) SetLineAsFirstVisible(line int)
- func (self Instance) SetLineAsLastVisible(line int)
- func (self Instance) SetLineBackgroundColor(line int, color Color.RGBA)
- func (self Instance) SetLineGutterClickable(line int, gutter int, clickable bool)
- func (self Instance) SetLineGutterIcon(line int, gutter int, icon Texture2D.Instance)
- func (self Instance) SetLineGutterItemColor(line int, gutter int, color Color.RGBA)
- func (self Instance) SetLineGutterMetadata(line int, gutter int, metadata any)
- func (self Instance) SetLineGutterText(line int, gutter int, text string)
- func (self Instance) SetMiddleMousePasteEnabled(value bool)
- func (self Instance) SetMinimapDraw(value bool)
- func (self Instance) SetMinimapWidth(value int)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOvertypeModeEnabled(enabled bool)
- func (self Instance) SetPlaceholderText(value string)
- func (self Instance) SetScrollFitContentHeight(value bool)
- func (self Instance) SetScrollFitContentWidth(value bool)
- func (self Instance) SetScrollHorizontal(value int)
- func (self Instance) SetScrollPastEndOfFile(value bool)
- func (self Instance) SetScrollSmooth(value bool)
- func (self Instance) SetScrollVScrollSpeed(value Float.X)
- func (self Instance) SetScrollVertical(value Float.X)
- func (self Instance) SetSearchFlags(flags SearchFlags)
- func (self Instance) SetSearchText(search_text string)
- func (self Instance) SetSelectingEnabled(value bool)
- func (self Instance) SetSelectionMode(mode SelectionMode)
- func (self Instance) SetSelectionOriginColumn(column int)
- func (self Instance) SetSelectionOriginLine(line int)
- func (self Instance) SetShortcutKeysEnabled(value bool)
- func (self Instance) SetStructuredTextBidiOverride(value TextServer.StructuredTextParser)
- func (self Instance) SetStructuredTextBidiOverrideOptions(value []any)
- func (self Instance) SetTabInputMode(value bool)
- func (self Instance) SetTabSize(size int)
- func (self Instance) SetText(value string)
- func (self Instance) SetTextDirection(value Control.TextDirection)
- func (self Instance) SetTooltipRequestFunc(callback func(hovered_word string) string)
- func (self Instance) SetUseCustomWordSeparators(value bool)
- func (self Instance) SetUseDefaultWordSeparators(value bool)
- func (self Instance) SetVirtualKeyboardEnabled(value bool)
- func (self Instance) SetVirtualKeyboardShowOnFocus(value bool)
- func (self Instance) SetWrapMode(value LineWrappingMode)
- func (self Instance) ShortcutKeysEnabled() bool
- func (self Instance) SkipSelectionForNextOccurrence()
- func (self Instance) StartAction(action EditAction)
- func (self Instance) StructuredTextBidiOverride() TextServer.StructuredTextParser
- func (self Instance) StructuredTextBidiOverrideOptions() []any
- func (self Instance) SwapLines(from_line int, to_line int)
- func (self Instance) TabInputMode() bool
- func (self Instance) TagSavedVersion()
- func (self Instance) Text() string
- func (self Instance) TextDirection() Control.TextDirection
- func (self Instance) Undo()
- func (self Instance) UseCustomWordSeparators() bool
- func (self Instance) UseDefaultWordSeparators() bool
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) VirtualKeyboardEnabled() bool
- func (self Instance) VirtualKeyboardShowOnFocus() bool
- func (self Instance) WrapMode() LineWrappingMode
- type Interface
- type LineWrappingMode
- type MenuItems
- type MoreArgs
- func (self MoreArgs) AddGutter(at int)
- func (self MoreArgs) AdjustViewportToCaret(caret_index int)
- func (self MoreArgs) Backspace(caret_index int)
- func (self MoreArgs) CenterViewportToCaret(caret_index int)
- func (self MoreArgs) CollapseCarets(from_line int, from_column int, to_line int, to_column int, inclusive bool)
- func (self MoreArgs) Copy(caret_index int)
- func (self MoreArgs) Cut(caret_index int)
- func (self MoreArgs) DeleteSelection(caret_index int)
- func (self MoreArgs) Deselect(caret_index int)
- func (self MoreArgs) GetCaretColumn(caret_index int) int
- func (self MoreArgs) GetCaretDrawPos(caret_index int) Vector2.XY
- func (self MoreArgs) GetCaretLine(caret_index int) int
- func (self MoreArgs) GetCaretWrapIndex(caret_index int) int
- func (self MoreArgs) GetLineColumnAtPos(position Vector2i.XY, clamp_line bool, clamp_column bool) Vector2i.XY
- func (self MoreArgs) GetLineRangesFromCarets(only_selections bool, merge_adjacent bool) []Vector2i.XY
- func (self MoreArgs) GetLineWidth(line int, wrap_index int) int
- func (self MoreArgs) GetScrollPosForLine(line int, wrap_index int) Float.X
- func (self MoreArgs) GetSelectedText(caret_index int) string
- func (self MoreArgs) GetSelectionAtLineColumn(line int, column int, include_edges bool, only_selections bool) int
- func (self MoreArgs) GetSelectionColumn(caret_index int) int
- func (self MoreArgs) GetSelectionFromColumn(caret_index int) int
- func (self MoreArgs) GetSelectionFromLine(caret_index int) int
- func (self MoreArgs) GetSelectionLine(caret_index int) int
- func (self MoreArgs) GetSelectionOriginColumn(caret_index int) int
- func (self MoreArgs) GetSelectionOriginLine(caret_index int) int
- func (self MoreArgs) GetSelectionToColumn(caret_index int) int
- func (self MoreArgs) GetSelectionToLine(caret_index int) int
- func (self MoreArgs) GetSortedCarets(include_ignored_carets bool) []int32
- func (self MoreArgs) GetWordUnderCaret(caret_index int) string
- func (self MoreArgs) HasSelection(caret_index int) bool
- func (self MoreArgs) InsertText(text string, line int, column int, before_selection_begin bool, ...)
- func (self MoreArgs) InsertTextAtCaret(text string, caret_index int)
- func (self MoreArgs) IsCaretAfterSelectionOrigin(caret_index int) bool
- func (self MoreArgs) IsCaretVisible(caret_index int) bool
- func (self MoreArgs) IsMouseOverSelection(edges bool, caret_index int) bool
- func (self MoreArgs) Paste(caret_index int)
- func (self MoreArgs) PastePrimaryClipboard(caret_index int)
- func (self MoreArgs) RemoveLineAt(line int, move_carets_down bool)
- func (self MoreArgs) Select(origin_line int, origin_column int, caret_line int, caret_column int, ...)
- func (self MoreArgs) SelectWordUnderCaret(caret_index int)
- func (self MoreArgs) SetCaretColumn(column int, adjust_viewport bool, caret_index int)
- func (self MoreArgs) SetCaretLine(line int, adjust_viewport bool, can_be_hidden bool, wrap_index int, ...)
- func (self MoreArgs) SetLineAsCenterVisible(line int, wrap_index int)
- func (self MoreArgs) SetLineAsFirstVisible(line int, wrap_index int)
- func (self MoreArgs) SetLineAsLastVisible(line int, wrap_index int)
- func (self MoreArgs) SetSelectionOriginColumn(column int, caret_index int)
- func (self MoreArgs) SetSelectionOriginLine(line int, can_be_hidden bool, wrap_index int, caret_index int)
- type SearchFlags
- type SelectionMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type EditAction ¶
type EditAction int //gd:TextEdit.EditAction
const ( // No current action. ActionNone EditAction = 0 // A typing action. ActionTyping EditAction = 1 // A backwards delete action. ActionBackspace EditAction = 2 // A forward delete action. ActionDelete EditAction = 3 )
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this [Extension]See Interface for methods that can be overridden by T.
func (*Extension[T]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
func (*Extension[T]) AsTextEdit ¶
type GutterType ¶
type GutterType int //gd:TextEdit.GutterType
const ( // When a gutter is set to string using [SetGutterType], it is used to contain text set via the [SetLineGutterText] method. // // [SetGutterType]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetGutterType // [SetLineGutterText]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetLineGutterText GutterTypeString GutterType = 0 // When a gutter is set to icon using [SetGutterType], it is used to contain an icon set via the [SetLineGutterIcon] method. // // [SetGutterType]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetGutterType // [SetLineGutterIcon]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetLineGutterIcon GutterTypeIcon GutterType = 1 // When a gutter is set to custom using [SetGutterType], it is used to contain custom visuals controlled by a callback method set via the [SetGutterCustomDraw] method. // // [SetGutterCustomDraw]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetGutterCustomDraw // [SetGutterType]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetGutterType GutterTypeCustom GutterType = 2 )
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddCaret ¶
Adds a new caret at the given location. Returns the index of the new caret, or -1 if the location is invalid.
func (Instance) AddCaretAtCarets ¶
Adds an additional caret above or below every caret. If 'below' is true the new caret will be added below and above otherwise.
func (Instance) AddGutter ¶
func (self Instance) AddGutter()
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 (Instance) AddSelectionForNextOccurrence ¶
func (self Instance) 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 (Instance) AdjustCaretsAfterEdit ¶
func (self Instance) AdjustCaretsAfterEdit(caret int, from_line int, from_col int, to_line int, to_col int)
This method does nothing.
func (Instance) AdjustViewportToCaret ¶
func (self Instance) AdjustViewportToCaret()
Adjust the viewport so the caret is visible.
func (Instance) ApplyIme ¶
func (self Instance) ApplyIme()
Applies text from the Input Method Editor (IME) to each caret and closes the IME if it is open.
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) AsTextEdit ¶
func (Instance) AutowrapMode ¶
func (self Instance) AutowrapMode() TextServer.AutowrapMode
If WrapMode is set to LineWrappingBoundary, sets text wrapping mode.
func (Instance) Backspace ¶
func (self Instance) Backspace()
Called when the user presses the backspace key. Can be overridden with Backspace.
func (Instance) BackspaceDeletesCompositeCharacterEnabled ¶
If true and CaretMidGrapheme is false, backspace deletes an entire composite character such as ❤️🩹, instead of deleting part of the composite character.
func (Instance) BeginComplexOperation ¶
func (self Instance) BeginComplexOperation()
Starts a multipart edit. All edits will be treated as one action until EndComplexOperation is called.
func (Instance) BeginMulticaretEdit ¶
func (self Instance) 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.
textEdit.BeginComplexOperation() textEdit.BeginMulticaretEdit() for i := 0; i < textEdit.GetCaretCount(); i++ { if textEdit.MulticaretEditIgnoreCaret(i) { continue } // Logic here. } textEdit.EndMulticaretEdit() textEdit.EndComplexOperation()
func (Instance) CancelIme ¶
func (self Instance) CancelIme()
Closes the Input Method Editor (IME) if it is open. Any text in the IME will be lost.
func (Instance) CaretBlinkInterval ¶
The interval at which the caret blinks (in seconds).
func (Instance) CaretDrawWhenEditableDisabled ¶
If true, caret will be visible when Editable is disabled.
func (Instance) CaretMidGrapheme ¶
Allow moving caret, selecting and removing the individual composite character components.
Note: Backspace is always removing individual composite character components.
func (Instance) CaretMoveOnRightClick ¶
If true, a right-click moves the caret at the mouse position before displaying the context menu.
If false, the context menu ignores mouse location.
func (Instance) CaretMultiple ¶
If true, multiple carets are allowed. Left-clicking with Alt adds a new caret. See AddCaret and GetCaretCount.
func (Instance) CenterViewportToCaret ¶
func (self Instance) CenterViewportToCaret()
Centers the viewport on the line the editing caret is at. This also resets the ScrollHorizontal value to 0.
func (Instance) Clear ¶
func (self Instance) Clear()
Performs a full reset of TextEdit, including undo history.
func (Instance) CollapseCarets ¶
Collapse all carets in the given range to the 'from_line' and 'from_column' position.
'inclusive' applies to both ends.
If IsInMulitcaretEdit is true, carets that are collapsed will be true for MulticaretEditIgnoreCaret.
MergeOverlappingCarets will be called if any carets were collapsed.
func (Instance) ContextMenuEnabled ¶
If true, a right-click displays the context menu.
func (Instance) Copy ¶
func (self Instance) Copy()
Copies the current text selection. Can be overridden with Copy.
func (Instance) CustomWordSeparators ¶
The characters to consider as word delimiters if UseCustomWordSeparators is true. The characters should be defined without separation, for example #_!.
func (Instance) Cut ¶
func (self Instance) Cut()
Cut's the current selection. Can be overridden with Cut.
func (Instance) DeselectOnFocusLossEnabled ¶
If true, the selected text will be deselected when focus is lost.
func (Instance) DragAndDropSelectionEnabled ¶
If true, allow drag and drop of selected text. Text can still be dropped from other sources.
func (Instance) DrawControlChars ¶
If true, control characters are displayed.
func (Instance) DrawSpaces ¶
If true, the "space" character will have a visible representation.
func (Instance) EmojiMenuEnabled ¶
If true, "Emoji and Symbols" menu is enabled.
func (Instance) EmptySelectionClipboardEnabled ¶
If true, copying or cutting without a selection is performed on all lines with a caret. Otherwise, copy and cut require a selection.
func (Instance) EndAction ¶
func (self Instance) EndAction()
Marks the end of steps in the current action started with StartAction.
func (Instance) EndComplexOperation ¶
func (self Instance) 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 (Instance) EndMulticaretEdit ¶
func (self Instance) 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 (Instance) GetCaretColumn ¶
Returns the column the editing caret is at.
func (Instance) GetCaretCount ¶
Returns the number of carets in this TextEdit.
func (Instance) GetCaretDrawPos ¶
Returns the caret pixel draw position.
func (Instance) GetCaretIndexEditOrder ¶
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 InsertTextAtCaret are applied.
func (Instance) GetCaretLine ¶
Returns the line the editing caret is on.
func (Instance) GetCaretWrapIndex ¶
Returns the wrap index the editing caret is on.
func (Instance) GetFirstNonWhitespaceColumn ¶
Returns the first column containing a non-whitespace character on the given line. If there is only whitespace, returns the number of characters.
func (Instance) GetFirstVisibleLine ¶
Returns the first visible line.
func (Instance) GetGutterCount ¶
Returns the number of gutters registered.
func (Instance) GetGutterName ¶
Returns the name of the gutter at the given index.
func (Instance) GetGutterType ¶
func (self Instance) GetGutterType(gutter int) GutterType
Returns the type of the gutter at the given index. Gutters can contain icons, text, or custom visuals.
func (Instance) GetGutterWidth ¶
Returns the width of the gutter at the given index.
func (Instance) GetHScrollBar ¶
func (self Instance) GetHScrollBar() HScrollBar.Instance
Returns the HScrollBar used by TextEdit.
func (Instance) GetIndentLevel ¶
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 GetTabSize).
func (Instance) GetLastFullVisibleLine ¶
Returns the last visible line. Use GetLastFullVisibleLineWrapIndex for the wrap index.
func (Instance) GetLastFullVisibleLineWrapIndex ¶
Returns the last visible wrap index of the last visible line.
func (Instance) GetLastUnhiddenLine ¶
Returns the last unhidden line in the entire TextEdit.
func (Instance) GetLineBackgroundColor ¶
Returns the custom background color of the given line. If no color is set, returns Color(0, 0, 0, 0).
func (Instance) GetLineColumnAtPos ¶
Returns the line and column at the given position. In the returned vector, x is the column and y is the line.
If 'clamp_line' is false and 'position' is below the last line, Vector2i(-1, -1) is returned.
If 'clamp_column' is false and 'position' is outside the column range of the line, Vector2i(-1, -1) is returned.
func (Instance) GetLineCount ¶
Returns the number of lines in the text.
func (Instance) GetLineGutterIcon ¶
Returns the icon currently in 'gutter' at 'line'. This only works when the gutter type is GutterTypeIcon (see SetGutterType).
func (Instance) GetLineGutterItemColor ¶
Returns the color currently in 'gutter' at 'line'.
func (Instance) GetLineGutterMetadata ¶
Returns the metadata currently in 'gutter' at 'line'.
func (Instance) GetLineGutterText ¶
Returns the text currently in 'gutter' at 'line'. This only works when the gutter type is GutterTypeString (see SetGutterType).
func (Instance) GetLineHeight ¶
Returns the maximum value of the line height among all lines.
Note: The return value is influenced by theme's 'line_spacing' and theme's 'font_size'. And it will not be less than 1.
func (Instance) GetLineRangesFromCarets ¶
Returns an slice 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.
If a selection's end column (GetSelectionToColumn) is at column 0, that line will not be included. If a selection begins on the line after another selection ends and 'merge_adjacent' is true, or they begin and end on the same line, one line range will include both selections.
func (Instance) GetLineWidth ¶
Returns the width in pixels of the 'wrap_index' on 'line'.
func (Instance) GetLineWithIme ¶
Returns line text as it is currently displayed, including IME composition string.
func (Instance) GetLineWrapCount ¶
Returns the number of times the given line is wrapped.
func (Instance) GetLineWrapIndexAtColumn ¶
Returns the wrap index of the given column on the given line. This ranges from 0 to GetLineWrapCount.
func (Instance) GetLineWrappedText ¶
Returns an array of strings representing each wrapped index.
func (Instance) GetLocalMousePos ¶
Returns the local mouse position adjusted for the text direction.
func (Instance) GetMenu ¶
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 MenuItems). For example:
var menu = textEdit.GetMenu() // Remove all items after "Redo". menu.SetItemCount(menu.GetItemIndex(int(TextEdit.MenuRedo)) + 1) // Add custom items. menu.AddSeparator() menu.MoreArgs().AddItem("Insert Date", int(TextEdit.MenuMax)+1, 0) // Connect callback. menu.OnIdPressed(func(id int) { if id == int(TextEdit.MenuMax)+1 { textEdit.InsertTextAtCaret(Time.GetDateStringFromSystem(false)) } })
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 Window.Visible property.
func (Instance) GetMinimapLineAtPos ¶
Returns the equivalent minimap line at 'position'.
func (Instance) GetMinimapVisibleLines ¶
Returns the number of lines that may be drawn on the minimap.
func (Instance) GetNextCompositeCharacterColumn ¶
Returns the correct column at the end of a composite character like ❤️🩹 (mending heart; Unicode: U+2764 U+FE0F U+200D U+1FA79) which is comprised of more than one Unicode code point, if the caret is at the start of the composite character. Also returns the correct column with the caret at mid grapheme and for non-composite characters.
Note: To check at caret location use get_next_composite_character_column(get_caret_line(), get_caret_column())
func (Instance) GetNextVisibleLineIndexOffsetFrom ¶
func (self Instance) GetNextVisibleLineIndexOffsetFrom(line int, wrap_index int, visible_amount int) Vector2i.XY
Similar to GetNextVisibleLineOffsetFrom, but takes into account the line wrap indexes. In the returned vector, x is the line, y is the wrap index.
func (Instance) GetNextVisibleLineOffsetFrom ¶
Returns 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 (Instance) GetPosAtLineColumn ¶
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 GetRectAtLineColumn to get the top side position.
func (Instance) GetPreviousCompositeCharacterColumn ¶
Returns the correct column at the start of a composite character like ❤️🩹 (mending heart; Unicode: U+2764 U+FE0F U+200D U+1FA79) which is comprised of more than one Unicode code point, if the caret is at the end of the composite character. Also returns the correct column with the caret at mid grapheme and for non-composite characters.
Note: To check at caret location use get_previous_composite_character_column(get_caret_line(), get_caret_column())
func (Instance) GetRectAtLineColumn ¶
func (self Instance) GetRectAtLineColumn(line int, column int) Rect2i.PositionSize
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 GetPosAtLineColumn which returns the bottom side.
func (Instance) GetSavedVersion ¶
Returns the last tagged saved version from TagSavedVersion.
func (Instance) GetScrollPosForLine ¶
Returns the scroll position for 'wrap_index' of 'line'.
func (Instance) GetSelectedText ¶
Returns the text inside the selection of a caret, or all the carets if 'caret_index' is its default value -1.
func (Instance) GetSelectionAtLineColumn ¶
Returns the caret index of the selection at the given 'line' and 'column', or -1 if there is none.
If 'include_edges' is false, the position must be inside the selection and not at either end. If 'only_selections' is false, carets without a selection will also be considered.
func (Instance) GetSelectionColumn ¶
Returns the original start column of the selection.
func (Instance) GetSelectionFromColumn ¶
Returns the selection begin column. Returns the caret column if there is no selection.
func (Instance) GetSelectionFromLine ¶
Returns the selection begin line. Returns the caret line if there is no selection.
func (Instance) GetSelectionLine ¶
Returns the original start line of the selection.
func (Instance) GetSelectionMode ¶
func (self Instance) GetSelectionMode() SelectionMode
Returns the current selection mode.
func (Instance) GetSelectionOriginColumn ¶
Returns the origin column of the selection. This is the opposite end from the caret.
func (Instance) GetSelectionOriginLine ¶
Returns the origin line of the selection. This is the opposite end from the caret.
func (Instance) GetSelectionToColumn ¶
Returns the selection end column. Returns the caret column if there is no selection.
func (Instance) GetSelectionToLine ¶
Returns the selection end line. Returns the caret line if there is no selection.
func (Instance) GetSortedCarets ¶
Returns the carets sorted by selection beginning from lowest line and column to highest (from top to bottom of text).
If 'include_ignored_carets' is false, carets from MulticaretEditIgnoreCaret will be ignored.
func (Instance) GetTabSize ¶
Returns the TextEdit's' tab size.
func (Instance) GetTotalGutterWidth ¶
Returns the total width of all gutters and internal padding.
func (Instance) GetTotalVisibleLineCount ¶
Returns the total number of lines in the text. This includes wrapped lines and excludes folded lines. If WrapMode is set to LineWrappingNone and no lines are folded (see CodeEdit.IsLineFolded) then this is equivalent to GetLineCount. See GetVisibleLineCountInRange for a limited range of lines.
func (Instance) GetVScrollBar ¶
func (self Instance) GetVScrollBar() VScrollBar.Instance
Returns the VScrollBar of the TextEdit.
func (Instance) GetVersion ¶
Returns the current version of the TextEdit. The version is a count of recorded operations by the undo/redo history.
func (Instance) GetVisibleLineCount ¶
Returns the number of lines that can visually fit, rounded down, based on this control's height.
func (Instance) GetVisibleLineCountInRange ¶
Returns the total number of lines between 'from_line' and 'to_line' (inclusive) in the text. This includes wrapped lines and excludes folded lines. If the range covers all lines it is equivalent to GetTotalVisibleLineCount.
func (Instance) GetWordAtPos ¶
Returns the word at 'position'.
func (Instance) GetWordUnderCaret ¶
Returns a string text with the word under the caret's location.
func (Instance) HasImeText ¶
Returns true if the user has text in the Input Method Editor (IME).
func (Instance) HasSelection ¶
Returns true if the user has selected text.
func (Instance) HighlightAllOccurrences ¶
If true, all occurrences of the selected text will be highlighted.
func (Instance) HighlightCurrentLine ¶
If true, the line containing the cursor is highlighted.
func (Instance) IndentWrappedLines ¶
If true, all wrapped lines are indented to the same amount as the unwrapped line.
func (Instance) InsertLineAt ¶
Inserts a new line with 'text' at 'line'.
func (Instance) InsertText ¶
Inserts the 'text' at 'line' and 'column'.
If 'before_selection_begin' is true, carets and selections that begin at 'line' and 'column' will moved to the end of the inserted text, along with all carets after it.
If 'before_selection_end' is true, selections that end at 'line' and '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.
func (Instance) InsertTextAtCaret ¶
Insert the specified text at the caret position.
func (Instance) IsCaretAfterSelectionOrigin ¶
Returns true if the caret of the selection is after the selection origin. This can be used to determine the direction of the selection.
func (Instance) IsCaretVisible ¶
Returns true if the caret is visible, false otherwise. A caret will be considered hidden if it is outside the scrollable area when scrolling is enabled.
Note: IsCaretVisible does not account for a caret being off-screen if it is still within the scrollable area. It will return true even if the caret is off-screen as long as it meets TextEdit's own conditions for being visible. This includes uses of ScrollFitContentWidth and ScrollFitContentHeight that cause the TextEdit to expand beyond the viewport's bounds.
func (Instance) IsDraggingCursor ¶
Returns true if the user is dragging their mouse for scrolling, selecting, or text dragging.
func (Instance) IsGutterClickable ¶
Returns true if the gutter at the given index is clickable. See SetGutterClickable.
func (Instance) IsGutterDrawn ¶
Returns true if the gutter at the given index is currently drawn. See SetGutterDraw.
func (Instance) IsGutterOverwritable ¶
Returns true if the gutter at the given index is overwritable. See SetGutterOverwritable.
func (Instance) IsInMulitcaretEdit ¶
Returns true if a BeginMulticaretEdit has been called and EndMulticaretEdit has not yet been called.
func (Instance) IsLineGutterClickable ¶
Returns true if the gutter at the given index on the given line is clickable. See SetLineGutterClickable.
func (Instance) IsLineWrapped ¶
Returns if the given line is wrapped.
func (Instance) IsMenuVisible ¶
Returns true if the menu is visible. Use this instead of get_menu().visible to improve performance (so the creation of the menu is avoided). See GetMenu.
func (Instance) IsMouseOverSelection ¶
Returns true if the mouse is over a selection. If 'edges' is true, the edges are considered part of the selection.
func (Instance) IsOvertypeModeEnabled ¶
Returns true if overtype mode is enabled. See SetOvertypeModeEnabled.
func (Instance) Language ¶
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
func (Instance) MenuOption ¶
Executes a given action as defined in the MenuItems enum.
func (Instance) MergeGutters ¶
Merge the gutters from 'from_line' into 'to_line'. Only overwritable gutters will be copied. See SetGutterOverwritable.
func (Instance) MergeOverlappingCarets ¶
func (self Instance) MergeOverlappingCarets()
Merges any overlapping carets. Will favor the newest caret, or the caret with a selection.
If IsInMulitcaretEdit is true, the merge will be queued to happen at the end of the multicaret edit. See BeginMulticaretEdit and EndMulticaretEdit.
Note: 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.
func (Instance) MiddleMousePasteEnabled ¶
If false, using middle mouse button to paste clipboard will be disabled.
Note: This method is only implemented on Linux.
func (Instance) MinimapDraw ¶
If true, a minimap is shown, providing an outline of your source code. The minimap uses a fixed-width text size.
func (Instance) MinimapWidth ¶
The width, in pixels, of the minimap.
func (Instance) MoreArgs ¶
MoreArgs enables certain functions to be called with additional 'optional' arguments.
func (Instance) MulticaretEditIgnoreCaret ¶
Returns true if the given 'caret_index' 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.
It is recommended to continue within a loop iterating on multiple carets if a caret should be ignored.
func (Instance) OnCaretChanged ¶
Emitted when any caret changes position.
func (Instance) OnGutterAdded ¶
Emitted when a gutter is added.
func (Instance) OnGutterClicked ¶
Emitted when a gutter is clicked.
func (Instance) OnGutterRemoved ¶
Emitted when a gutter is removed.
func (Instance) OnLinesEditedFrom ¶
Emitted immediately when the text changes.
When text is added 'from_line' will be less than 'to_line'. On a remove 'to_line' will be less than 'from_line'.
func (Instance) OnTextChanged ¶
Emitted when the text changes.
func (Instance) Paste ¶
func (self Instance) Paste()
Paste at the current location. Can be overridden with Paste.
func (Instance) PastePrimaryClipboard ¶
func (self Instance) PastePrimaryClipboard()
Pastes the primary clipboard.
func (Instance) PlaceholderText ¶
Text shown when the TextEdit is empty. It is not the TextEdit's default value (see Text).
func (Instance) RemoveCaret ¶
Removes the given caret index.
Note: This can result in adjustment of all other caret indices.
func (Instance) RemoveGutter ¶
Removes the gutter at the given index.
func (Instance) RemoveLineAt ¶
Removes the line of text at 'line'. Carets on this line will attempt to match their previous visual x position.
If 'move_carets_down' is true carets will move to the next line down, otherwise carets will move up.
func (Instance) RemoveSecondaryCarets ¶
func (self Instance) RemoveSecondaryCarets()
Removes all additional carets.
func (Instance) RemoveText ¶
Removes text between the given positions.
func (Instance) ScrollFitContentHeight ¶
If true, TextEdit will disable vertical scroll and fit minimum height to the number of visible lines. When both this property and ScrollFitContentWidth are true, no scrollbars will be displayed.
func (Instance) ScrollFitContentWidth ¶
If true, TextEdit will disable horizontal scroll and fit minimum width to the widest line in the text. When both this property and ScrollFitContentHeight are true, no scrollbars will be displayed.
func (Instance) ScrollHorizontal ¶
If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels.
func (Instance) ScrollPastEndOfFile ¶
Allow scrolling past the last line into "virtual" space.
func (Instance) ScrollSmooth ¶
Scroll smoothly over the text rather than jumping to the next location.
func (Instance) ScrollVScrollSpeed ¶
Sets the scroll speed with the minimap or when ScrollSmooth is enabled.
func (Instance) ScrollVertical ¶
If there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line.
func (Instance) Search ¶
func (self Instance) Search(text string, flags SearchFlags, from_line int, from_column int) (int, int)
Perform a search inside the text. Search flags can be specified in the SearchFlags enum.
In the returned vector, x is the column, y is the line. If no results are found, both are equal to -1.
line, column := textEdit.Search("print", TextEdit.SearchWholeWords, 0, 0)
func (Instance) Select ¶
Selects text from 'origin_line' and 'origin_column' to 'caret_line' and 'caret_column' for the given 'caret_index'. This moves the selection origin and the caret. If the positions are the same, the selection will be deselected.
If SelectingEnabled is false, no selection will occur.
Note: If supporting multiple carets this will not check for any overlap. See MergeOverlappingCarets.
func (Instance) SelectAll ¶
func (self Instance) SelectAll()
Select all the text.
If SelectingEnabled is false, no selection will occur.
func (Instance) SelectWordUnderCaret ¶
func (self Instance) SelectWordUnderCaret()
Selects the word under the caret.
func (Instance) SelectingEnabled ¶
If true, text can be selected.
If false, text can not be selected by the user or by the Select or SelectAll methods.
func (Instance) SetAutowrapMode ¶
func (self Instance) SetAutowrapMode(value TextServer.AutowrapMode)
SetAutowrapMode sets the property returned by [GetAutowrapMode].
func (Instance) SetBackspaceDeletesCompositeCharacterEnabled ¶
SetBackspaceDeletesCompositeCharacterEnabled sets the property returned by [IsBackspaceDeletesCompositeCharacterEnabled].
func (Instance) SetCaretBlink ¶
SetCaretBlink sets the property returned by [IsCaretBlinkEnabled].
func (Instance) SetCaretBlinkInterval ¶
SetCaretBlinkInterval sets the property returned by [GetCaretBlinkInterval].
func (Instance) SetCaretColumn ¶
Moves the caret to the specified 'column' index.
If 'adjust_viewport' is true, the viewport will center at the caret position after the move occurs.
Note: If supporting multiple carets this will not check for any overlap. See MergeOverlappingCarets.
func (Instance) SetCaretDrawWhenEditableDisabled ¶
SetCaretDrawWhenEditableDisabled sets the property returned by [IsDrawingCaretWhenEditableDisabled].
func (Instance) SetCaretLine ¶
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 was called, or clamped to the end of the line.
If 'adjust_viewport' is true, the viewport will center at the caret position after the move occurs.
If 'can_be_hidden' is true, the specified 'line' can be hidden.
If 'wrap_index' is -1, the caret column will be clamped to the 'line”s length. If 'wrap_index' is greater than -1, the column will be moved to attempt to match the visual x position on the line's 'wrap_index' to the position from the last time SetCaretColumn was called.
Note: If supporting multiple carets this will not check for any overlap. See MergeOverlappingCarets.
func (Instance) SetCaretMidGrapheme ¶
SetCaretMidGrapheme sets the property returned by [IsCaretMidGraphemeEnabled].
func (Instance) SetCaretMoveOnRightClick ¶
SetCaretMoveOnRightClick sets the property returned by [IsMoveCaretOnRightClickEnabled].
func (Instance) SetCaretMultiple ¶
SetCaretMultiple sets the property returned by [IsMultipleCaretsEnabled].
func (Instance) SetCaretType ¶
SetCaretType sets the property returned by [GetCaretType].
func (Instance) SetContextMenuEnabled ¶
SetContextMenuEnabled sets the property returned by [IsContextMenuEnabled].
func (Instance) SetCustomWordSeparators ¶
SetCustomWordSeparators sets the property returned by [GetCustomWordSeparators].
func (Instance) SetDeselectOnFocusLossEnabled ¶
SetDeselectOnFocusLossEnabled sets the property returned by [IsDeselectOnFocusLossEnabled].
func (Instance) SetDragAndDropSelectionEnabled ¶
SetDragAndDropSelectionEnabled sets the property returned by [IsDragAndDropSelectionEnabled].
func (Instance) SetDrawControlChars ¶
SetDrawControlChars sets the property returned by [GetDrawControlChars].
func (Instance) SetDrawSpaces ¶
SetDrawSpaces sets the property returned by [IsDrawingSpaces].
func (Instance) SetDrawTabs ¶
SetDrawTabs sets the property returned by [IsDrawingTabs].
func (Instance) SetEditable ¶
SetEditable sets the property returned by [IsEditable].
func (Instance) SetEmojiMenuEnabled ¶
SetEmojiMenuEnabled sets the property returned by [IsEmojiMenuEnabled].
func (Instance) SetEmptySelectionClipboardEnabled ¶
SetEmptySelectionClipboardEnabled sets the property returned by [IsEmptySelectionClipboardEnabled].
func (Instance) SetGutterClickable ¶
If true, the mouse cursor will change to a pointing hand ([Control.CursorPointingHand]) when hovering over the gutter at the given index. See IsGutterClickable and SetLineGutterClickable.
func (Instance) SetGutterCustomDraw ¶
func (self Instance) SetGutterCustomDraw(column int, draw_callback func(line int, gutter int, area Rect2.PositionSize))
Set a custom draw callback for the gutter at the given index. 'draw_callback' must take the following arguments: A line index int, a gutter index int, and an area Rect2.PositionSize. This callback only works when the gutter type is GutterTypeCustom (see SetGutterType).
func (Instance) SetGutterDraw ¶
If true, the gutter at the given index is drawn. The gutter type (SetGutterType) determines how it is drawn. See IsGutterDrawn.
func (Instance) SetGutterName ¶
Sets the name of the gutter at the given index.
func (Instance) SetGutterOverwritable ¶
If true, the line data of the gutter at the given index can be overridden when using MergeGutters. See IsGutterOverwritable.
func (Instance) SetGutterType ¶
func (self Instance) SetGutterType(gutter int, atype GutterType)
Sets the type of gutter at the given index. Gutters can contain icons, text, or custom visuals.
func (Instance) SetGutterWidth ¶
Set the width of the gutter at the given index.
func (Instance) SetHighlightAllOccurrences ¶
SetHighlightAllOccurrences sets the property returned by [IsHighlightAllOccurrencesEnabled].
func (Instance) SetHighlightCurrentLine ¶
SetHighlightCurrentLine sets the property returned by [IsHighlightCurrentLineEnabled].
func (Instance) SetIndentWrappedLines ¶
SetIndentWrappedLines sets the property returned by [IsIndentWrappedLines].
func (Instance) SetLanguage ¶
SetLanguage sets the property returned by [GetLanguage].
func (Instance) SetLine ¶
Sets the text for a specific 'line'.
Carets on the line will attempt to keep their visual x position.
func (Instance) SetLineAsCenterVisible ¶
Positions the 'wrap_index' of 'line' at the center of the viewport.
func (Instance) SetLineAsFirstVisible ¶
Positions the 'wrap_index' of 'line' at the top of the viewport.
func (Instance) SetLineAsLastVisible ¶
Positions the 'wrap_index' of 'line' at the bottom of the viewport.
func (Instance) SetLineBackgroundColor ¶
Sets the custom background color of the given line. If transparent, this color is applied on top of the default background color (See theme's 'background_color'). If set to Color(0, 0, 0, 0), no additional color is applied.
func (Instance) SetLineGutterClickable ¶
If 'clickable' is true, makes the 'gutter' on the given 'line' clickable. This is like SetGutterClickable, but for a single line. If IsGutterClickable is true, this will not have any effect. See IsLineGutterClickable and OnGutterClicked.
func (Instance) SetLineGutterIcon ¶
Sets the icon for 'gutter' on 'line' to 'icon'. This only works when the gutter type is GutterTypeIcon (see SetGutterType).
func (Instance) SetLineGutterItemColor ¶
Sets the color for 'gutter' on 'line' to 'color'.
func (Instance) SetLineGutterMetadata ¶
Sets the metadata for 'gutter' on 'line' to 'metadata'.
func (Instance) SetLineGutterText ¶
Sets the text for 'gutter' on 'line' to 'text'. This only works when the gutter type is GutterTypeString (see SetGutterType).
func (Instance) SetMiddleMousePasteEnabled ¶
SetMiddleMousePasteEnabled sets the property returned by [IsMiddleMousePasteEnabled].
func (Instance) SetMinimapDraw ¶
SetMinimapDraw sets the property returned by [IsDrawingMinimap].
func (Instance) SetMinimapWidth ¶
SetMinimapWidth sets the property returned by [GetMinimapWidth].
func (Instance) SetOvertypeModeEnabled ¶
If true, enables overtype mode. In this mode, typing overrides existing text instead of inserting text. The ProjectSettings "input/ui_text_toggle_insert_mode" action toggles overtype mode. See IsOvertypeModeEnabled.
func (Instance) SetPlaceholderText ¶
SetPlaceholderText sets the property returned by [GetPlaceholder].
func (Instance) SetScrollFitContentHeight ¶
SetScrollFitContentHeight sets the property returned by [IsFitContentHeightEnabled].
func (Instance) SetScrollFitContentWidth ¶
SetScrollFitContentWidth sets the property returned by [IsFitContentWidthEnabled].
func (Instance) SetScrollHorizontal ¶
SetScrollHorizontal sets the property returned by [GetHScroll].
func (Instance) SetScrollPastEndOfFile ¶
SetScrollPastEndOfFile sets the property returned by [IsScrollPastEndOfFileEnabled].
func (Instance) SetScrollSmooth ¶
SetScrollSmooth sets the property returned by [IsSmoothScrollEnabled].
func (Instance) SetScrollVScrollSpeed ¶
SetScrollVScrollSpeed sets the property returned by [GetVScrollSpeed].
func (Instance) SetScrollVertical ¶
SetScrollVertical sets the property returned by [GetVScroll].
func (Instance) SetSearchFlags ¶
func (self Instance) SetSearchFlags(flags SearchFlags)
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 (Instance) SetSearchText ¶
Sets the search text. See SetSearchFlags.
func (Instance) SetSelectingEnabled ¶
SetSelectingEnabled sets the property returned by [IsSelectingEnabled].
func (Instance) SetSelectionMode ¶
func (self Instance) SetSelectionMode(mode SelectionMode)
Sets the current selection mode.
func (Instance) SetSelectionOriginColumn ¶
Sets the selection origin column to the 'column' for the given 'caret_index'. If the selection origin is moved to the caret position, the selection will deselect.
func (Instance) SetSelectionOriginLine ¶
Sets the selection origin line to the 'line' for the given 'caret_index'. If the selection origin is moved to the caret position, the selection will deselect.
If 'can_be_hidden' is false, The line will be set to the nearest unhidden line below or above.
If 'wrap_index' is -1, the selection origin column will be clamped to the 'line”s length. If 'wrap_index' is greater than -1, the column will be moved to attempt to match the visual x position on the line's 'wrap_index' to the position from the last time SetSelectionOriginColumn or Select was called.
func (Instance) SetShortcutKeysEnabled ¶
SetShortcutKeysEnabled sets the property returned by [IsShortcutKeysEnabled].
func (Instance) SetStructuredTextBidiOverride ¶
func (self Instance) SetStructuredTextBidiOverride(value TextServer.StructuredTextParser)
SetStructuredTextBidiOverride sets the property returned by [GetStructuredTextBidiOverride].
func (Instance) SetStructuredTextBidiOverrideOptions ¶
SetStructuredTextBidiOverrideOptions sets the property returned by [GetStructuredTextBidiOverrideOptions].
func (Instance) SetTabInputMode ¶
SetTabInputMode sets the property returned by [GetTabInputMode].
func (Instance) SetTabSize ¶
Sets the tab size for the TextEdit to use.
func (Instance) SetTextDirection ¶
func (self Instance) SetTextDirection(value Control.TextDirection)
SetTextDirection sets the property returned by [GetTextDirection].
func (Instance) SetTooltipRequestFunc ¶
Provide custom tooltip text. The callback method must take the following args: hovered_word: String.
func (Instance) SetUseCustomWordSeparators ¶
SetUseCustomWordSeparators sets the property returned by [IsCustomWordSeparatorsEnabled].
func (Instance) SetUseDefaultWordSeparators ¶
SetUseDefaultWordSeparators sets the property returned by [IsDefaultWordSeparatorsEnabled].
func (Instance) SetVirtualKeyboardEnabled ¶
SetVirtualKeyboardEnabled sets the property returned by [IsVirtualKeyboardEnabled].
func (Instance) SetVirtualKeyboardShowOnFocus ¶
SetVirtualKeyboardShowOnFocus sets the property returned by [GetVirtualKeyboardShowOnFocus].
func (Instance) SetWrapMode ¶
func (self Instance) SetWrapMode(value LineWrappingMode)
SetWrapMode sets the property returned by [GetLineWrappingMode].
func (Instance) ShortcutKeysEnabled ¶
If true, shortcut keys for context menu items are enabled, even if the context menu is disabled.
func (Instance) SkipSelectionForNextOccurrence ¶
func (self Instance) 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 (Instance) StartAction ¶
func (self Instance) StartAction(action EditAction)
Starts an action, will end the current action if 'action' is different.
An action will also end after a call to EndAction, after ProjectSettings "gui/timers/text_edit_idle_detect_sec" is triggered or a new undoable step outside the StartAction and EndAction calls.
func (Instance) StructuredTextBidiOverride ¶
func (self Instance) StructuredTextBidiOverride() TextServer.StructuredTextParser
Set BiDi algorithm override for the structured text.
func (Instance) StructuredTextBidiOverrideOptions ¶
Set additional options for BiDi override.
func (Instance) TabInputMode ¶
If true, ProjectSettings "input/ui_text_indent" input Tab character, otherwise it moves keyboard focus to the next Control in the scene.
func (Instance) TagSavedVersion ¶
func (self Instance) TagSavedVersion()
Tag the current version as saved.
func (Instance) TextDirection ¶
func (self Instance) TextDirection() Control.TextDirection
Base text writing direction.
func (Instance) UseCustomWordSeparators ¶
If false, using Ctrl + Left or Ctrl + Right (Cmd + Left or Cmd + Right on macOS) bindings will use the behavior of UseDefaultWordSeparators. If true, it will also stop the caret if a character within CustomWordSeparators is detected. Useful for subword moving. This behavior also will be applied to the behavior of text selection.
func (Instance) UseDefaultWordSeparators ¶
If false, using Ctrl + Left or Ctrl + Right (Cmd + Left or Cmd + Right on macOS) bindings will stop moving caret only if a space or punctuation is detected. If true, it will also stop the caret if a character is part of !"#$%&'()*+,-./:;<=>?@[\]^`{|}~, 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.
func (Instance) VirtualKeyboardEnabled ¶
If true, the native virtual keyboard is enabled on platforms that support it.
func (Instance) VirtualKeyboardShowOnFocus ¶
If true, the native virtual keyboard is shown on focus events on platforms that support it.
func (Instance) WrapMode ¶
func (self Instance) WrapMode() LineWrappingMode
Sets the line wrapping mode to use.
type Interface ¶
type Interface interface { // Override this method to define what happens when the user types in the provided key 'unicode_char'. HandleUnicodeInput(unicode_char int, caret_index int) // Override this method to define what happens when the user presses the backspace key. Backspace(caret_index int) // Override this method to define what happens when the user performs a cut operation. Cut(caret_index int) // Override this method to define what happens when the user performs a copy operation. Copy(caret_index int) // Override this method to define what happens when the user performs a paste operation. Paste(caret_index int) // Override this method to define what happens when the user performs a paste operation with middle mouse button. // // Note: This method is only implemented on Linux. PastePrimaryClipboard(caret_index int) }
type LineWrappingMode ¶
type LineWrappingMode int //gd:TextEdit.LineWrappingMode
const ( // Line wrapping is disabled. LineWrappingNone LineWrappingMode = 0 // Line wrapping occurs at the control boundary, beyond what would normally be visible. LineWrappingBoundary LineWrappingMode = 1 )
type MenuItems ¶
type MenuItems int //gd:TextEdit.MenuItems
const ( // Cuts (copies and clears) the selected text. MenuCut MenuItems = 0 // Copies the selected text. MenuCopy MenuItems = 1 // Pastes the clipboard text over the selected text (or at the cursor's position). MenuPaste MenuItems = 2 // Erases the whole [TextEdit] text. // // [TextEdit]: https://pkg.go.dev/graphics.gd/classdb/TextEdit MenuClear MenuItems = 3 // Selects the whole [TextEdit] text. // // [TextEdit]: https://pkg.go.dev/graphics.gd/classdb/TextEdit MenuSelectAll MenuItems = 4 // Undoes the previous action. MenuUndo MenuItems = 5 // Redoes the previous action. MenuRedo MenuItems = 6 MenuSubmenuTextDir MenuItems = 7 // Sets text direction to inherited. MenuDirInherited MenuItems = 8 // Sets text direction to automatic. MenuDirAuto MenuItems = 9 // Sets text direction to left-to-right. MenuDirLtr MenuItems = 10 // Sets text direction to right-to-left. MenuDirRtl MenuItems = 11 // Toggles control character display. MenuDisplayUcc MenuItems = 12 MenuSubmenuInsertUcc MenuItems = 13 // Inserts left-to-right mark (LRM) character. MenuInsertLrm MenuItems = 14 // Inserts right-to-left mark (RLM) character. MenuInsertRlm MenuItems = 15 // Inserts start of left-to-right embedding (LRE) character. MenuInsertLre MenuItems = 16 // Inserts start of right-to-left embedding (RLE) character. MenuInsertRle MenuItems = 17 // Inserts start of left-to-right override (LRO) character. MenuInsertLro MenuItems = 18 // Inserts start of right-to-left override (RLO) character. MenuInsertRlo MenuItems = 19 // Inserts pop direction formatting (PDF) character. MenuInsertPdf MenuItems = 20 // Inserts Arabic letter mark (ALM) character. MenuInsertAlm MenuItems = 21 // Inserts left-to-right isolate (LRI) character. MenuInsertLri MenuItems = 22 // Inserts right-to-left isolate (RLI) character. MenuInsertRli MenuItems = 23 // Inserts first strong isolate (FSI) character. MenuInsertFsi MenuItems = 24 // Inserts pop direction isolate (PDI) character. MenuInsertPdi MenuItems = 25 // Inserts zero width joiner (ZWJ) character. MenuInsertZwj MenuItems = 26 // Inserts zero width non-joiner (ZWNJ) character. MenuInsertZwnj MenuItems = 27 // Inserts word joiner (WJ) character. MenuInsertWj MenuItems = 28 // Inserts soft hyphen (SHY) character. MenuInsertShy MenuItems = 29 // Opens system emoji and symbol picker. MenuEmojiAndSymbol MenuItems = 30 // Represents the size of the [MenuItems] enum. MenuMax MenuItems = 31 )
type MoreArgs ¶
MoreArgs is a container for Instance functions with additional 'optional' arguments.
func (MoreArgs) AddGutter ¶
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 (MoreArgs) AdjustViewportToCaret ¶
Adjust the viewport so the caret is visible.
func (MoreArgs) Backspace ¶
Called when the user presses the backspace key. Can be overridden with Backspace.
func (MoreArgs) CenterViewportToCaret ¶
Centers the viewport on the line the editing caret is at. This also resets the ScrollHorizontal value to 0.
func (MoreArgs) CollapseCarets ¶
func (self MoreArgs) CollapseCarets(from_line int, from_column int, to_line int, to_column int, inclusive bool)
Collapse all carets in the given range to the 'from_line' and 'from_column' position.
'inclusive' applies to both ends.
If IsInMulitcaretEdit is true, carets that are collapsed will be true for MulticaretEditIgnoreCaret.
MergeOverlappingCarets will be called if any carets were collapsed.
func (MoreArgs) DeleteSelection ¶
Deletes the selected text.
func (MoreArgs) GetCaretColumn ¶
Returns the column the editing caret is at.
func (MoreArgs) GetCaretDrawPos ¶
Returns the caret pixel draw position.
func (MoreArgs) GetCaretLine ¶
Returns the line the editing caret is on.
func (MoreArgs) GetCaretWrapIndex ¶
Returns the wrap index the editing caret is on.
func (MoreArgs) GetLineColumnAtPos ¶
func (self MoreArgs) GetLineColumnAtPos(position Vector2i.XY, clamp_line bool, clamp_column bool) Vector2i.XY
Returns the line and column at the given position. In the returned vector, x is the column and y is the line.
If 'clamp_line' is false and 'position' is below the last line, Vector2i(-1, -1) is returned.
If 'clamp_column' is false and 'position' is outside the column range of the line, Vector2i(-1, -1) is returned.
func (MoreArgs) GetLineRangesFromCarets ¶
func (self MoreArgs) GetLineRangesFromCarets(only_selections bool, merge_adjacent bool) []Vector2i.XY
Returns an slice 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.
If a selection's end column (GetSelectionToColumn) is at column 0, that line will not be included. If a selection begins on the line after another selection ends and 'merge_adjacent' is true, or they begin and end on the same line, one line range will include both selections.
func (MoreArgs) GetLineWidth ¶
Returns the width in pixels of the 'wrap_index' on 'line'.
func (MoreArgs) GetScrollPosForLine ¶
Returns the scroll position for 'wrap_index' of 'line'.
func (MoreArgs) GetSelectedText ¶
Returns the text inside the selection of a caret, or all the carets if 'caret_index' is its default value -1.
func (MoreArgs) GetSelectionAtLineColumn ¶
func (self MoreArgs) GetSelectionAtLineColumn(line int, column int, include_edges bool, only_selections bool) int
Returns the caret index of the selection at the given 'line' and 'column', or -1 if there is none.
If 'include_edges' is false, the position must be inside the selection and not at either end. If 'only_selections' is false, carets without a selection will also be considered.
func (MoreArgs) GetSelectionColumn ¶
Returns the original start column of the selection.
func (MoreArgs) GetSelectionFromColumn ¶
Returns the selection begin column. Returns the caret column if there is no selection.
func (MoreArgs) GetSelectionFromLine ¶
Returns the selection begin line. Returns the caret line if there is no selection.
func (MoreArgs) GetSelectionLine ¶
Returns the original start line of the selection.
func (MoreArgs) GetSelectionOriginColumn ¶
Returns the origin column of the selection. This is the opposite end from the caret.
func (MoreArgs) GetSelectionOriginLine ¶
Returns the origin line of the selection. This is the opposite end from the caret.
func (MoreArgs) GetSelectionToColumn ¶
Returns the selection end column. Returns the caret column if there is no selection.
func (MoreArgs) GetSelectionToLine ¶
Returns the selection end line. Returns the caret line if there is no selection.
func (MoreArgs) GetSortedCarets ¶
Returns the carets sorted by selection beginning from lowest line and column to highest (from top to bottom of text).
If 'include_ignored_carets' is false, carets from MulticaretEditIgnoreCaret will be ignored.
func (MoreArgs) GetWordUnderCaret ¶
Returns a string text with the word under the caret's location.
func (MoreArgs) HasSelection ¶
Returns true if the user has selected text.
func (MoreArgs) InsertText ¶
func (self MoreArgs) InsertText(text string, line int, column int, before_selection_begin bool, before_selection_end bool)
Inserts the 'text' at 'line' and 'column'.
If 'before_selection_begin' is true, carets and selections that begin at 'line' and 'column' will moved to the end of the inserted text, along with all carets after it.
If 'before_selection_end' is true, selections that end at 'line' and '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.
func (MoreArgs) InsertTextAtCaret ¶
Insert the specified text at the caret position.
func (MoreArgs) IsCaretAfterSelectionOrigin ¶
Returns true if the caret of the selection is after the selection origin. This can be used to determine the direction of the selection.
func (MoreArgs) IsCaretVisible ¶
Returns true if the caret is visible, false otherwise. A caret will be considered hidden if it is outside the scrollable area when scrolling is enabled.
Note: IsCaretVisible does not account for a caret being off-screen if it is still within the scrollable area. It will return true even if the caret is off-screen as long as it meets TextEdit's own conditions for being visible. This includes uses of ScrollFitContentWidth and ScrollFitContentHeight that cause the TextEdit to expand beyond the viewport's bounds.
func (MoreArgs) IsMouseOverSelection ¶
Returns true if the mouse is over a selection. If 'edges' is true, the edges are considered part of the selection.
func (MoreArgs) PastePrimaryClipboard ¶
Pastes the primary clipboard.
func (MoreArgs) RemoveLineAt ¶
Removes the line of text at 'line'. Carets on this line will attempt to match their previous visual x position.
If 'move_carets_down' is true carets will move to the next line down, otherwise carets will move up.
func (MoreArgs) Select ¶
func (self MoreArgs) Select(origin_line int, origin_column int, caret_line int, caret_column int, caret_index int)
Selects text from 'origin_line' and 'origin_column' to 'caret_line' and 'caret_column' for the given 'caret_index'. This moves the selection origin and the caret. If the positions are the same, the selection will be deselected.
If SelectingEnabled is false, no selection will occur.
Note: If supporting multiple carets this will not check for any overlap. See MergeOverlappingCarets.
func (MoreArgs) SelectWordUnderCaret ¶
Selects the word under the caret.
func (MoreArgs) SetCaretColumn ¶
Moves the caret to the specified 'column' index.
If 'adjust_viewport' is true, the viewport will center at the caret position after the move occurs.
Note: If supporting multiple carets this will not check for any overlap. See MergeOverlappingCarets.
func (MoreArgs) SetCaretLine ¶
func (self MoreArgs) SetCaretLine(line int, adjust_viewport bool, can_be_hidden bool, wrap_index int, caret_index int)
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 was called, or clamped to the end of the line.
If 'adjust_viewport' is true, the viewport will center at the caret position after the move occurs.
If 'can_be_hidden' is true, the specified 'line' can be hidden.
If 'wrap_index' is -1, the caret column will be clamped to the 'line”s length. If 'wrap_index' is greater than -1, the column will be moved to attempt to match the visual x position on the line's 'wrap_index' to the position from the last time SetCaretColumn was called.
Note: If supporting multiple carets this will not check for any overlap. See MergeOverlappingCarets.
func (MoreArgs) SetLineAsCenterVisible ¶
Positions the 'wrap_index' of 'line' at the center of the viewport.
func (MoreArgs) SetLineAsFirstVisible ¶
Positions the 'wrap_index' of 'line' at the top of the viewport.
func (MoreArgs) SetLineAsLastVisible ¶
Positions the 'wrap_index' of 'line' at the bottom of the viewport.
func (MoreArgs) SetSelectionOriginColumn ¶
Sets the selection origin column to the 'column' for the given 'caret_index'. If the selection origin is moved to the caret position, the selection will deselect.
func (MoreArgs) SetSelectionOriginLine ¶
func (self MoreArgs) SetSelectionOriginLine(line int, can_be_hidden bool, wrap_index int, caret_index int)
Sets the selection origin line to the 'line' for the given 'caret_index'. If the selection origin is moved to the caret position, the selection will deselect.
If 'can_be_hidden' is false, The line will be set to the nearest unhidden line below or above.
If 'wrap_index' is -1, the selection origin column will be clamped to the 'line”s length. If 'wrap_index' is greater than -1, the column will be moved to attempt to match the visual x position on the line's 'wrap_index' to the position from the last time SetSelectionOriginColumn or Select was called.
type SearchFlags ¶
type SearchFlags int //gd:TextEdit.SearchFlags
const ( // Match case when searching. SearchMatchCase SearchFlags = 1 // Match whole words when searching. SearchWholeWords SearchFlags = 2 // Search from end to beginning. SearchBackwards SearchFlags = 4 )
type SelectionMode ¶
type SelectionMode int //gd:TextEdit.SelectionMode
const ( // Not selecting. SelectionModeNone SelectionMode = 0 // Select as if shift is pressed. SelectionModeShift SelectionMode = 1 // Select single characters as if the user single clicked. SelectionModePointer SelectionMode = 2 // Select whole words as if the user double clicked. SelectionModeWord SelectionMode = 3 // Select whole lines as if the user triple clicked. SelectionModeLine SelectionMode = 4 )