Debian Codegraph @

doc/classes/TextEdit.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <class name="TextEdit" inherits="Control" keywords="textarea" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A multiline text editor.
5 </brief_description>
6 <description>
7 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].
8 While entering text, it is possible to insert special characters using Unicode, OEM or Windows alt codes:
9 - To enter Unicode codepoints, hold [kbd]Alt[/kbd] and type the codepoint on the numpad. For example, to enter the character [code]á[/code] (U+00E1), hold [kbd]Alt[/kbd] and type [kbd]+E1[/kbd] on the numpad (the leading zeroes can be omitted).
10 - To enter OEM codepoints, hold [kbd]Alt[/kbd] and type the code on the numpad. For example, to enter the character [code]á[/code] (OEM 160), hold [kbd]Alt[/kbd] and type [code]160[/code] on the numpad.
11 - To enter Windows codepoints, hold [kbd]Alt[/kbd] and type the code on the numpad. For example, to enter the character [code]á[/code] (Windows 0225), hold [kbd]Alt[/kbd] and type [kbd]0[/kbd], [kbd]2[/kbd], [kbd]2[/kbd], [kbd]5[/kbd] on the numpad. The leading zero here must [b]not[/b] be omitted, as this is how Windows codepoints are distinguished from OEM codepoints.
12 [b]Note:[/b] Most viewport, caret, and edit methods contain a [code]caret_index[/code] argument for [member caret_multiple] support. The argument should be one of the following: [code]-1[/code] for all carets, [code]0[/code] for the main caret, or greater than [code]0[/code] for secondary carets in the order they were created.
13 [b]Note:[/b] When holding down [kbd]Alt[/kbd], the vertical scroll wheel will scroll 5 times as fast as it would normally do. This also works in the Godot script editor.
14 </description>
15 <tutorials>
16 </tutorials>
17 <methods>
18 <method name="_backspace" qualifiers="virtual">
19 <return type="void" />
20 <param index="0" name="caret_index" type="int" />
21 <description>
22 Override this method to define what happens when the user presses the backspace key.
23 </description>
24 </method>
25 <method name="_copy" qualifiers="virtual">
26 <return type="void" />
27 <param index="0" name="caret_index" type="int" />
28 <description>
29 Override this method to define what happens when the user performs a copy operation.
30 </description>
31 </method>
32 <method name="_cut" qualifiers="virtual">
33 <return type="void" />
34 <param index="0" name="caret_index" type="int" />
35 <description>
36 Override this method to define what happens when the user performs a cut operation.
37 </description>
38 </method>
39 <method name="_handle_unicode_input" qualifiers="virtual">
40 <return type="void" />
41 <param index="0" name="unicode_char" type="int" />
42 <param index="1" name="caret_index" type="int" />
43 <description>
44 Override this method to define what happens when the user types in the provided key [param unicode_char].
45 </description>
46 </method>
47 <method name="_paste" qualifiers="virtual">
48 <return type="void" />
49 <param index="0" name="caret_index" type="int" />
50 <description>
51 Override this method to define what happens when the user performs a paste operation.
52 </description>
53 </method>
54 <method name="_paste_primary_clipboard" qualifiers="virtual">
55 <return type="void" />
56 <param index="0" name="caret_index" type="int" />
57 <description>
58 Override this method to define what happens when the user performs a paste operation with middle mouse button.
59 [b]Note:[/b] This method is only implemented on Linux.
60 </description>
61 </method>
62 <method name="add_caret">
63 <return type="int" />
64 <param index="0" name="line" type="int" />
65 <param index="1" name="column" type="int" />
66 <description>
67 Adds a new caret at the given location. Returns the index of the new caret, or [code]-1[/code] if the location is invalid.
68 </description>
69 </method>
70 <method name="add_caret_at_carets">
71 <return type="void" />
72 <param index="0" name="below" type="bool" />
73 <description>
74 Adds an additional caret above or below every caret. If [param below] is [code]true[/code] the new caret will be added below and above otherwise.
75 </description>
76 </method>
77 <method name="add_gutter">
78 <return type="void" />
79 <param index="0" name="at" type="int" default="-1" />
80 <description>
81 Register a new gutter to this [TextEdit]. Use [param at] to have a specific gutter order. A value of [code]-1[/code] appends the gutter to the right.
82 </description>
83 </method>
84 <method name="add_selection_for_next_occurrence">
85 <return type="void" />
86 <description>
87 Adds a selection and a caret for the next occurrence of the current selection. If there is no active selection, selects word under caret.
88 </description>
89 </method>
90 <method name="adjust_carets_after_edit" deprecated="No longer necessary since methods now adjust carets themselves.">
91 <return type="void" />
92 <param index="0" name="caret" type="int" />
93 <param index="1" name="from_line" type="int" />
94 <param index="2" name="from_col" type="int" />
95 <param index="3" name="to_line" type="int" />
96 <param index="4" name="to_col" type="int" />
97 <description>
98 This method does nothing.
99 </description>
100 </method>
101 <method name="adjust_viewport_to_caret">
102 <return type="void" />
103 <param index="0" name="caret_index" type="int" default="0" />
104 <description>
105 Adjust the viewport so the caret is visible.
106 </description>
107 </method>
108 <method name="apply_ime">
109 <return type="void" />
110 <description>
111 Applies text from the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME) to each caret and closes the IME if it is open.
112 </description>
113 </method>
114 <method name="backspace">
115 <return type="void" />
116 <param index="0" name="caret_index" type="int" default="-1" />
117 <description>
118 Called when the user presses the backspace key. Can be overridden with [method _backspace].
119 </description>
120 </method>
121 <method name="begin_complex_operation">
122 <return type="void" />
123 <description>
124 Starts a multipart edit. All edits will be treated as one action until [method end_complex_operation] is called.
125 </description>
126 </method>
127 <method name="begin_multicaret_edit">
128 <return type="void" />
129 <description>
130 Starts an edit for multiple carets. The edit must be ended with [method end_multicaret_edit]. Multicaret edits can be used to edit text at multiple carets and delay merging the carets until the end, so the caret indexes aren't affected immediately. [method begin_multicaret_edit] and [method end_multicaret_edit] can be nested, and the merge will happen at the last [method end_multicaret_edit].
131 [codeblock]
132 begin_complex_operation()
133 begin_multicaret_edit()
134 for i in range(get_caret_count()):
135 if multicaret_edit_ignore_caret(i):
136 continue
137 # Logic here.
138 end_multicaret_edit()
139 end_complex_operation()
140 [/codeblock]
141 </description>
142 </method>
143 <method name="cancel_ime">
144 <return type="void" />
145 <description>
146 Closes the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME) if it is open. Any text in the IME will be lost.
147 </description>
148 </method>
149 <method name="center_viewport_to_caret">
150 <return type="void" />
151 <param index="0" name="caret_index" type="int" default="0" />
152 <description>
153 Centers the viewport on the line the editing caret is at. This also resets the [member scroll_horizontal] value to [code]0[/code].
154 </description>
155 </method>
156 <method name="clear">
157 <return type="void" />
158 <description>
159 Performs a full reset of [TextEdit], including undo history.
160 </description>
161 </method>
162 <method name="clear_undo_history">
163 <return type="void" />
164 <description>
165 Clears the undo history.
166 </description>
167 </method>
168 <method name="collapse_carets">
169 <return type="void" />
170 <param index="0" name="from_line" type="int" />
171 <param index="1" name="from_column" type="int" />
172 <param index="2" name="to_line" type="int" />
173 <param index="3" name="to_column" type="int" />
174 <param index="4" name="inclusive" type="bool" default="false" />
175 <description>
176 Collapse all carets in the given range to the [param from_line] and [param from_column] position.
177 [param inclusive] applies to both ends.
178 If [method is_in_mulitcaret_edit] is [code]true[/code], carets that are collapsed will be [code]true[/code] for [method multicaret_edit_ignore_caret].
179 [method merge_overlapping_carets] will be called if any carets were collapsed.
180 </description>
181 </method>
182 <method name="copy">
183 <return type="void" />
184 <param index="0" name="caret_index" type="int" default="-1" />
185 <description>
186 Copies the current text selection. Can be overridden with [method _copy].
187 </description>
188 </method>
189 <method name="cut">
190 <return type="void" />
191 <param index="0" name="caret_index" type="int" default="-1" />
192 <description>
193 Cut's the current selection. Can be overridden with [method _cut].
194 </description>
195 </method>
196 <method name="delete_selection">
197 <return type="void" />
198 <param index="0" name="caret_index" type="int" default="-1" />
199 <description>
200 Deletes the selected text.
201 </description>
202 </method>
203 <method name="deselect">
204 <return type="void" />
205 <param index="0" name="caret_index" type="int" default="-1" />
206 <description>
207 Deselects the current selection.
208 </description>
209 </method>
210 <method name="end_action">
211 <return type="void" />
212 <description>
213 Marks the end of steps in the current action started with [method start_action].
214 </description>
215 </method>
216 <method name="end_complex_operation">
217 <return type="void" />
218 <description>
219 Ends a multipart edit, started with [method begin_complex_operation]. If called outside a complex operation, the current operation is pushed onto the undo/redo stack.
220 </description>
221 </method>
222 <method name="end_multicaret_edit">
223 <return type="void" />
224 <description>
225 Ends an edit for multiple carets, that was started with [method begin_multicaret_edit]. If this was the last [method end_multicaret_edit] and [method merge_overlapping_carets] was called, carets will be merged.
226 </description>
227 </method>
228 <method name="get_caret_column" qualifiers="const">
229 <return type="int" />
230 <param index="0" name="caret_index" type="int" default="0" />
231 <description>
232 Returns the column the editing caret is at.
233 </description>
234 </method>
235 <method name="get_caret_count" qualifiers="const">
236 <return type="int" />
237 <description>
238 Returns the number of carets in this [TextEdit].
239 </description>
240 </method>
241 <method name="get_caret_draw_pos" qualifiers="const">
242 <return type="Vector2" />
243 <param index="0" name="caret_index" type="int" default="0" />
244 <description>
245 Returns the caret pixel draw position.
246 </description>
247 </method>
248 <method name="get_caret_index_edit_order" deprecated="Carets no longer need to be edited in any specific order. If the carets need to be sorted, use [method get_sorted_carets] instead.">
249 <return type="PackedInt32Array" />
250 <description>
251 Returns a list of caret indexes in their edit order, this done from bottom to top. Edit order refers to the way actions such as [method insert_text_at_caret] are applied.
252 </description>
253 </method>
254 <method name="get_caret_line" qualifiers="const">
255 <return type="int" />
256 <param index="0" name="caret_index" type="int" default="0" />
257 <description>
258 Returns the line the editing caret is on.
259 </description>
260 </method>
261 <method name="get_caret_wrap_index" qualifiers="const">
262 <return type="int" />
263 <param index="0" name="caret_index" type="int" default="0" />
264 <description>
265 Returns the wrap index the editing caret is on.
266 </description>
267 </method>
268 <method name="get_first_non_whitespace_column" qualifiers="const">
269 <return type="int" />
270 <param index="0" name="line" type="int" />
271 <description>
272 Returns the first column containing a non-whitespace character on the given line. If there is only whitespace, returns the number of characters.
273 </description>
274 </method>
275 <method name="get_first_visible_line" qualifiers="const">
276 <return type="int" />
277 <description>
278 Returns the first visible line.
279 </description>
280 </method>
281 <method name="get_gutter_count" qualifiers="const">
282 <return type="int" />
283 <description>
284 Returns the number of gutters registered.
285 </description>
286 </method>
287 <method name="get_gutter_name" qualifiers="const">
288 <return type="String" />
289 <param index="0" name="gutter" type="int" />
290 <description>
291 Returns the name of the gutter at the given index.
292 </description>
293 </method>
294 <method name="get_gutter_type" qualifiers="const">
295 <return type="int" enum="TextEdit.GutterType" />
296 <param index="0" name="gutter" type="int" />
297 <description>
298 Returns the type of the gutter at the given index. Gutters can contain icons, text, or custom visuals.
299 </description>
300 </method>
301 <method name="get_gutter_width" qualifiers="const">
302 <return type="int" />
303 <param index="0" name="gutter" type="int" />
304 <description>
305 Returns the width of the gutter at the given index.
306 </description>
307 </method>
308 <method name="get_h_scroll_bar" qualifiers="const">
309 <return type="HScrollBar" />
310 <description>
311 Returns the [HScrollBar] used by [TextEdit].
312 </description>
313 </method>
314 <method name="get_indent_level" qualifiers="const">
315 <return type="int" />
316 <param index="0" name="line" type="int" />
317 <description>
318 Returns the indent level of the given line. This is the number of spaces and tabs at the beginning of the line, with the tabs taking the tab size into account (see [method get_tab_size]).
319 </description>
320 </method>
321 <method name="get_last_full_visible_line" qualifiers="const">
322 <return type="int" />
323 <description>
324 Returns the last visible line. Use [method get_last_full_visible_line_wrap_index] for the wrap index.
325 </description>
326 </method>
327 <method name="get_last_full_visible_line_wrap_index" qualifiers="const">
328 <return type="int" />
329 <description>
330 Returns the last visible wrap index of the last visible line.
331 </description>
332 </method>
333 <method name="get_last_unhidden_line" qualifiers="const">
334 <return type="int" />
335 <description>
336 Returns the last unhidden line in the entire [TextEdit].
337 </description>
338 </method>
339 <method name="get_line" qualifiers="const">
340 <return type="String" />
341 <param index="0" name="line" type="int" />
342 <description>
343 Returns the text of a specific line.
344 </description>
345 </method>
346 <method name="get_line_background_color" qualifiers="const">
347 <return type="Color" />
348 <param index="0" name="line" type="int" />
349 <description>
350 Returns the custom background color of the given line. If no color is set, returns [code]Color(0, 0, 0, 0)[/code].
351 </description>
352 </method>
353 <method name="get_line_column_at_pos" qualifiers="const">
354 <return type="Vector2i" />
355 <param index="0" name="position" type="Vector2i" />
356 <param index="1" name="clamp_line" type="bool" default="true" />
357 <param index="2" name="clamp_column" type="bool" default="true" />
358 <description>
359 Returns the line and column at the given position. In the returned vector, [code]x[/code] is the column and [code]y[/code] is the line.
360 If [param clamp_line] is [code]false[/code] and [param position] is below the last line, [code]Vector2i(-1, -1)[/code] is returned.
361 If [param clamp_column] is [code]false[/code] and [param position] is outside the column range of the line, [code]Vector2i(-1, -1)[/code] is returned.
362 </description>
363 </method>
364 <method name="get_line_count" qualifiers="const">
365 <return type="int" />
366 <description>
367 Returns the number of lines in the text.
368 </description>
369 </method>
370 <method name="get_line_gutter_icon" qualifiers="const">
371 <return type="Texture2D" />
372 <param index="0" name="line" type="int" />
373 <param index="1" name="gutter" type="int" />
374 <description>
375 Returns the icon currently in [param gutter] at [param line]. This only works when the gutter type is [constant GUTTER_TYPE_ICON] (see [method set_gutter_type]).
376 </description>
377 </method>
378 <method name="get_line_gutter_item_color" qualifiers="const">
379 <return type="Color" />
380 <param index="0" name="line" type="int" />
381 <param index="1" name="gutter" type="int" />
382 <description>
383 Returns the color currently in [param gutter] at [param line].
384 </description>
385 </method>
386 <method name="get_line_gutter_metadata" qualifiers="const">
387 <return type="Variant" />
388 <param index="0" name="line" type="int" />
389 <param index="1" name="gutter" type="int" />
390 <description>
391 Returns the metadata currently in [param gutter] at [param line].
392 </description>
393 </method>
394 <method name="get_line_gutter_text" qualifiers="const">
395 <return type="String" />
396 <param index="0" name="line" type="int" />
397 <param index="1" name="gutter" type="int" />
398 <description>
399 Returns the text currently in [param gutter] at [param line]. This only works when the gutter type is [constant GUTTER_TYPE_STRING] (see [method set_gutter_type]).
400 </description>
401 </method>
402 <method name="get_line_height" qualifiers="const">
403 <return type="int" />
404 <description>
405 Returns the maximum value of the line height among all lines.
406 [b]Note:[/b] The return value is influenced by [theme_item line_spacing] and [theme_item font_size]. And it will not be less than [code]1[/code].
407 </description>
408 </method>
409 <method name="get_line_ranges_from_carets" qualifiers="const">
410 <return type="Vector2i[]" />
411 <param index="0" name="only_selections" type="bool" default="false" />
412 <param index="1" name="merge_adjacent" type="bool" default="true" />
413 <description>
414 Returns an [Array] of line ranges where [code]x[/code] is the first line and [code]y[/code] is the last line. All lines within these ranges will have a caret on them or be part of a selection. Each line will only be part of one line range, even if it has multiple carets on it.
415 If a selection's end column ([method get_selection_to_column]) is at column [code]0[/code], that line will not be included. If a selection begins on the line after another selection ends and [param merge_adjacent] is [code]true[/code], or they begin and end on the same line, one line range will include both selections.
416 </description>
417 </method>
418 <method name="get_line_width" qualifiers="const">
419 <return type="int" />
420 <param index="0" name="line" type="int" />
421 <param index="1" name="wrap_index" type="int" default="-1" />
422 <description>
423 Returns the width in pixels of the [param wrap_index] on [param line].
424 </description>
425 </method>
426 <method name="get_line_with_ime" qualifiers="const">
427 <return type="String" />
428 <param index="0" name="line" type="int" />
429 <description>
430 Returns line text as it is currently displayed, including IME composition string.
431 </description>
432 </method>
433 <method name="get_line_wrap_count" qualifiers="const">
434 <return type="int" />
435 <param index="0" name="line" type="int" />
436 <description>
437 Returns the number of times the given line is wrapped.
438 </description>
439 </method>
440 <method name="get_line_wrap_index_at_column" qualifiers="const">
441 <return type="int" />
442 <param index="0" name="line" type="int" />
443 <param index="1" name="column" type="int" />
444 <description>
445 Returns the wrap index of the given column on the given line. This ranges from [code]0[/code] to [method get_line_wrap_count].
446 </description>
447 </method>
448 <method name="get_line_wrapped_text" qualifiers="const">
449 <return type="PackedStringArray" />
450 <param index="0" name="line" type="int" />
451 <description>
452 Returns an array of [String]s representing each wrapped index.
453 </description>
454 </method>
455 <method name="get_local_mouse_pos" qualifiers="const">
456 <return type="Vector2" />
457 <description>
458 Returns the local mouse position adjusted for the text direction.
459 </description>
460 </method>
461 <method name="get_menu" qualifiers="const">
462 <return type="PopupMenu" />
463 <description>
464 Returns the [PopupMenu] of this [TextEdit]. By default, this menu is displayed when right-clicking on the [TextEdit].
465 You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see [enum MenuItems]). For example:
466 [codeblocks]
467 [gdscript]
468 func _ready():
469 var menu = get_menu()
470 # Remove all items after "Redo".
471 menu.item_count = menu.get_item_index(MENU_REDO) + 1
472 # Add custom items.
473 menu.add_separator()
474 menu.add_item("Insert Date", MENU_MAX + 1)
475 # Connect callback.
476 menu.id_pressed.connect(_on_item_pressed)
477
478 func _on_item_pressed(id):
479 if id == MENU_MAX + 1:
480 insert_text_at_caret(Time.get_date_string_from_system())
481 [/gdscript]
482 [csharp]
483 public override void _Ready()
484 {
485 var menu = GetMenu();
486 // Remove all items after "Redo".
487 menu.ItemCount = menu.GetItemIndex(TextEdit.MenuItems.Redo) + 1;
488 // Add custom items.
489 menu.AddSeparator();
490 menu.AddItem("Insert Date", TextEdit.MenuItems.Max + 1);
491 // Add event handler.
492 menu.IdPressed += OnItemPressed;
493 }
494
495 public void OnItemPressed(int id)
496 {
497 if (id == TextEdit.MenuItems.Max + 1)
498 {
499 InsertTextAtCaret(Time.GetDateStringFromSystem());
500 }
501 }
502 [/csharp]
503 [/codeblocks]
504 [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
505 </description>
506 </method>
507 <method name="get_minimap_line_at_pos" qualifiers="const">
508 <return type="int" />
509 <param index="0" name="position" type="Vector2i" />
510 <description>
511 Returns the equivalent minimap line at [param position].
512 </description>
513 </method>
514 <method name="get_minimap_visible_lines" qualifiers="const">
515 <return type="int" />
516 <description>
517 Returns the number of lines that may be drawn on the minimap.
518 </description>
519 </method>
520 <method name="get_next_composite_character_column" qualifiers="const">
521 <return type="int" />
522 <param index="0" name="line" type="int" />
523 <param index="1" name="column" type="int" />
524 <description>
525 Returns the correct column at the end of a composite character like ❤️‍🩹 (mending heart; Unicode: [code]U+2764 U+FE0F U+200D U+1FA79[/code]) 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.
526 [b]Note:[/b] To check at caret location use [code]get_next_composite_character_column(get_caret_line(), get_caret_column())[/code]
527 </description>
528 </method>
529 <method name="get_next_visible_line_index_offset_from" qualifiers="const">
530 <return type="Vector2i" />
531 <param index="0" name="line" type="int" />
532 <param index="1" name="wrap_index" type="int" />
533 <param index="2" name="visible_amount" type="int" />
534 <description>
535 Similar to [method get_next_visible_line_offset_from], but takes into account the line wrap indexes. In the returned vector, [code]x[/code] is the line, [code]y[/code] is the wrap index.
536 </description>
537 </method>
538 <method name="get_next_visible_line_offset_from" qualifiers="const">
539 <return type="int" />
540 <param index="0" name="line" type="int" />
541 <param index="1" name="visible_amount" type="int" />
542 <description>
543 Returns the count to the next visible line from [param line] to [code]line + visible_amount[/code]. Can also count backwards. For example if a [TextEdit] has 5 lines with lines 2 and 3 hidden, calling this with [code]line = 1, visible_amount = 1[/code] would return 3.
544 </description>
545 </method>
546 <method name="get_pos_at_line_column" qualifiers="const">
547 <return type="Vector2i" />
548 <param index="0" name="line" type="int" />
549 <param index="1" name="column" type="int" />
550 <description>
551 Returns the local position for the given [param line] and [param column]. If [code]x[/code] or [code]y[/code] of the returned vector equal [code]-1[/code], the position is outside of the viewable area of the control.
552 [b]Note:[/b] The Y position corresponds to the bottom side of the line. Use [method get_rect_at_line_column] to get the top side position.
553 </description>
554 </method>
555 <method name="get_previous_composite_character_column" qualifiers="const">
556 <return type="int" />
557 <param index="0" name="line" type="int" />
558 <param index="1" name="column" type="int" />
559 <description>
560 Returns the correct column at the start of a composite character like ❤️‍🩹 (mending heart; Unicode: [code]U+2764 U+FE0F U+200D U+1FA79[/code]) 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.
561 [b]Note:[/b] To check at caret location use [code]get_previous_composite_character_column(get_caret_line(), get_caret_column())[/code]
562 </description>
563 </method>
564 <method name="get_rect_at_line_column" qualifiers="const">
565 <return type="Rect2i" />
566 <param index="0" name="line" type="int" />
567 <param index="1" name="column" type="int" />
568 <description>
569 Returns the local position and size for the grapheme at the given [param line] and [param column]. If [code]x[/code] or [code]y[/code] position of the returned rect equal [code]-1[/code], the position is outside of the viewable area of the control.
570 [b]Note:[/b] The Y position of the returned rect corresponds to the top side of the line, unlike [method get_pos_at_line_column] which returns the bottom side.
571 </description>
572 </method>
573 <method name="get_saved_version" qualifiers="const">
574 <return type="int" />
575 <description>
576 Returns the last tagged saved version from [method tag_saved_version].
577 </description>
578 </method>
579 <method name="get_scroll_pos_for_line" qualifiers="const">
580 <return type="float" />
581 <param index="0" name="line" type="int" />
582 <param index="1" name="wrap_index" type="int" default="0" />
583 <description>
584 Returns the scroll position for [param wrap_index] of [param line].
585 </description>
586 </method>
587 <method name="get_selected_text">
588 <return type="String" />
589 <param index="0" name="caret_index" type="int" default="-1" />
590 <description>
591 Returns the text inside the selection of a caret, or all the carets if [param caret_index] is its default value [code]-1[/code].
592 </description>
593 </method>
594 <method name="get_selection_at_line_column" qualifiers="const">
595 <return type="int" />
596 <param index="0" name="line" type="int" />
597 <param index="1" name="column" type="int" />
598 <param index="2" name="include_edges" type="bool" default="true" />
599 <param index="3" name="only_selections" type="bool" default="true" />
600 <description>
601 Returns the caret index of the selection at the given [param line] and [param column], or [code]-1[/code] if there is none.
602 If [param include_edges] is [code]false[/code], the position must be inside the selection and not at either end. If [param only_selections] is [code]false[/code], carets without a selection will also be considered.
603 </description>
604 </method>
605 <method name="get_selection_column" qualifiers="const" deprecated="Use [method get_selection_origin_column] instead.">
606 <return type="int" />
607 <param index="0" name="caret_index" type="int" default="0" />
608 <description>
609 Returns the original start column of the selection.
610 </description>
611 </method>
612 <method name="get_selection_from_column" qualifiers="const">
613 <return type="int" />
614 <param index="0" name="caret_index" type="int" default="0" />
615 <description>
616 Returns the selection begin column. Returns the caret column if there is no selection.
617 </description>
618 </method>
619 <method name="get_selection_from_line" qualifiers="const">
620 <return type="int" />
621 <param index="0" name="caret_index" type="int" default="0" />
622 <description>
623 Returns the selection begin line. Returns the caret line if there is no selection.
624 </description>
625 </method>
626 <method name="get_selection_line" qualifiers="const" deprecated="Use [method get_selection_origin_line] instead.">
627 <return type="int" />
628 <param index="0" name="caret_index" type="int" default="0" />
629 <description>
630 Returns the original start line of the selection.
631 </description>
632 </method>
633 <method name="get_selection_mode" qualifiers="const">
634 <return type="int" enum="TextEdit.SelectionMode" />
635 <description>
636 Returns the current selection mode.
637 </description>
638 </method>
639 <method name="get_selection_origin_column" qualifiers="const">
640 <return type="int" />
641 <param index="0" name="caret_index" type="int" default="0" />
642 <description>
643 Returns the origin column of the selection. This is the opposite end from the caret.
644 </description>
645 </method>
646 <method name="get_selection_origin_line" qualifiers="const">
647 <return type="int" />
648 <param index="0" name="caret_index" type="int" default="0" />
649 <description>
650 Returns the origin line of the selection. This is the opposite end from the caret.
651 </description>
652 </method>
653 <method name="get_selection_to_column" qualifiers="const">
654 <return type="int" />
655 <param index="0" name="caret_index" type="int" default="0" />
656 <description>
657 Returns the selection end column. Returns the caret column if there is no selection.
658 </description>
659 </method>
660 <method name="get_selection_to_line" qualifiers="const">
661 <return type="int" />
662 <param index="0" name="caret_index" type="int" default="0" />
663 <description>
664 Returns the selection end line. Returns the caret line if there is no selection.
665 </description>
666 </method>
667 <method name="get_sorted_carets" qualifiers="const">
668 <return type="PackedInt32Array" />
669 <param index="0" name="include_ignored_carets" type="bool" default="false" />
670 <description>
671 Returns the carets sorted by selection beginning from lowest line and column to highest (from top to bottom of text).
672 If [param include_ignored_carets] is [code]false[/code], carets from [method multicaret_edit_ignore_caret] will be ignored.
673 </description>
674 </method>
675 <method name="get_tab_size" qualifiers="const">
676 <return type="int" />
677 <description>
678 Returns the [TextEdit]'s' tab size.
679 </description>
680 </method>
681 <method name="get_total_gutter_width" qualifiers="const">
682 <return type="int" />
683 <description>
684 Returns the total width of all gutters and internal padding.
685 </description>
686 </method>
687 <method name="get_total_visible_line_count" qualifiers="const">
688 <return type="int" />
689 <description>
690 Returns the total number of lines in the text. This includes wrapped lines and excludes folded lines. If [member wrap_mode] is set to [constant LINE_WRAPPING_NONE] and no lines are folded (see [method CodeEdit.is_line_folded]) then this is equivalent to [method get_line_count]. See [method get_visible_line_count_in_range] for a limited range of lines.
691 </description>
692 </method>
693 <method name="get_v_scroll_bar" qualifiers="const">
694 <return type="VScrollBar" />
695 <description>
696 Returns the [VScrollBar] of the [TextEdit].
697 </description>
698 </method>
699 <method name="get_version" qualifiers="const">
700 <return type="int" />
701 <description>
702 Returns the current version of the [TextEdit]. The version is a count of recorded operations by the undo/redo history.
703 </description>
704 </method>
705 <method name="get_visible_line_count" qualifiers="const">
706 <return type="int" />
707 <description>
708 Returns the number of lines that can visually fit, rounded down, based on this control's height.
709 </description>
710 </method>
711 <method name="get_visible_line_count_in_range" qualifiers="const">
712 <return type="int" />
713 <param index="0" name="from_line" type="int" />
714 <param index="1" name="to_line" type="int" />
715 <description>
716 Returns the total number of lines between [param from_line] and [param to_line] (inclusive) in the text. This includes wrapped lines and excludes folded lines. If the range covers all lines it is equivalent to [method get_total_visible_line_count].
717 </description>
718 </method>
719 <method name="get_word_at_pos" qualifiers="const">
720 <return type="String" />
721 <param index="0" name="position" type="Vector2" />
722 <description>
723 Returns the word at [param position].
724 </description>
725 </method>
726 <method name="get_word_under_caret" qualifiers="const">
727 <return type="String" />
728 <param index="0" name="caret_index" type="int" default="-1" />
729 <description>
730 Returns a [String] text with the word under the caret's location.
731 </description>
732 </method>
733 <method name="has_ime_text" qualifiers="const">
734 <return type="bool" />
735 <description>
736 Returns [code]true[/code] if the user has text in the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME).
737 </description>
738 </method>
739 <method name="has_redo" qualifiers="const">
740 <return type="bool" />
741 <description>
742 Returns [code]true[/code] if a "redo" action is available.
743 </description>
744 </method>
745 <method name="has_selection" qualifiers="const">
746 <return type="bool" />
747 <param index="0" name="caret_index" type="int" default="-1" />
748 <description>
749 Returns [code]true[/code] if the user has selected text.
750 </description>
751 </method>
752 <method name="has_undo" qualifiers="const">
753 <return type="bool" />
754 <description>
755 Returns [code]true[/code] if an "undo" action is available.
756 </description>
757 </method>
758 <method name="insert_line_at">
759 <return type="void" />
760 <param index="0" name="line" type="int" />
761 <param index="1" name="text" type="String" />
762 <description>
763 Inserts a new line with [param text] at [param line].
764 </description>
765 </method>
766 <method name="insert_text">
767 <return type="void" />
768 <param index="0" name="text" type="String" />
769 <param index="1" name="line" type="int" />
770 <param index="2" name="column" type="int" />
771 <param index="3" name="before_selection_begin" type="bool" default="true" />
772 <param index="4" name="before_selection_end" type="bool" default="false" />
773 <description>
774 Inserts the [param text] at [param line] and [param column].
775 If [param before_selection_begin] is [code]true[/code], carets and selections that begin at [param line] and [param column] will moved to the end of the inserted text, along with all carets after it.
776 If [param before_selection_end] is [code]true[/code], selections that end at [param line] and [param column] will be extended to the end of the inserted text. These parameters can be used to insert text inside of or outside of selections.
777 </description>
778 </method>
779 <method name="insert_text_at_caret">
780 <return type="void" />
781 <param index="0" name="text" type="String" />
782 <param index="1" name="caret_index" type="int" default="-1" />
783 <description>
784 Insert the specified text at the caret position.
785 </description>
786 </method>
787 <method name="is_caret_after_selection_origin" qualifiers="const">
788 <return type="bool" />
789 <param index="0" name="caret_index" type="int" default="0" />
790 <description>
791 Returns [code]true[/code] if the caret of the selection is after the selection origin. This can be used to determine the direction of the selection.
792 </description>
793 </method>
794 <method name="is_caret_visible" qualifiers="const">
795 <return type="bool" />
796 <param index="0" name="caret_index" type="int" default="0" />
797 <description>
798 Returns [code]true[/code] if the caret is visible, [code]false[/code] otherwise. A caret will be considered hidden if it is outside the scrollable area when scrolling is enabled.
799 [b]Note:[/b] [method is_caret_visible] does not account for a caret being off-screen if it is still within the scrollable area. It will return [code]true[/code] even if the caret is off-screen as long as it meets [TextEdit]'s own conditions for being visible. This includes uses of [member scroll_fit_content_width] and [member scroll_fit_content_height] that cause the [TextEdit] to expand beyond the viewport's bounds.
800 </description>
801 </method>
802 <method name="is_dragging_cursor" qualifiers="const">
803 <return type="bool" />
804 <description>
805 Returns [code]true[/code] if the user is dragging their mouse for scrolling, selecting, or text dragging.
806 </description>
807 </method>
808 <method name="is_gutter_clickable" qualifiers="const">
809 <return type="bool" />
810 <param index="0" name="gutter" type="int" />
811 <description>
812 Returns [code]true[/code] if the gutter at the given index is clickable. See [method set_gutter_clickable].
813 </description>
814 </method>
815 <method name="is_gutter_drawn" qualifiers="const">
816 <return type="bool" />
817 <param index="0" name="gutter" type="int" />
818 <description>
819 Returns [code]true[/code] if the gutter at the given index is currently drawn. See [method set_gutter_draw].
820 </description>
821 </method>
822 <method name="is_gutter_overwritable" qualifiers="const">
823 <return type="bool" />
824 <param index="0" name="gutter" type="int" />
825 <description>
826 Returns [code]true[/code] if the gutter at the given index is overwritable. See [method set_gutter_overwritable].
827 </description>
828 </method>
829 <method name="is_in_mulitcaret_edit" qualifiers="const">
830 <return type="bool" />
831 <description>
832 Returns [code]true[/code] if a [method begin_multicaret_edit] has been called and [method end_multicaret_edit] has not yet been called.
833 </description>
834 </method>
835 <method name="is_line_gutter_clickable" qualifiers="const">
836 <return type="bool" />
837 <param index="0" name="line" type="int" />
838 <param index="1" name="gutter" type="int" />
839 <description>
840 Returns [code]true[/code] if the gutter at the given index on the given line is clickable. See [method set_line_gutter_clickable].
841 </description>
842 </method>
843 <method name="is_line_wrapped" qualifiers="const">
844 <return type="bool" />
845 <param index="0" name="line" type="int" />
846 <description>
847 Returns if the given line is wrapped.
848 </description>
849 </method>
850 <method name="is_menu_visible" qualifiers="const">
851 <return type="bool" />
852 <description>
853 Returns [code]true[/code] if the menu is visible. Use this instead of [code]get_menu().visible[/code] to improve performance (so the creation of the menu is avoided). See [method get_menu].
854 </description>
855 </method>
856 <method name="is_mouse_over_selection" qualifiers="const">
857 <return type="bool" />
858 <param index="0" name="edges" type="bool" />
859 <param index="1" name="caret_index" type="int" default="-1" />
860 <description>
861 Returns [code]true[/code] if the mouse is over a selection. If [param edges] is [code]true[/code], the edges are considered part of the selection.
862 </description>
863 </method>
864 <method name="is_overtype_mode_enabled" qualifiers="const">
865 <return type="bool" />
866 <description>
867 Returns [code]true[/code] if overtype mode is enabled. See [method set_overtype_mode_enabled].
868 </description>
869 </method>
870 <method name="menu_option">
871 <return type="void" />
872 <param index="0" name="option" type="int" />
873 <description>
874 Executes a given action as defined in the [enum MenuItems] enum.
875 </description>
876 </method>
877 <method name="merge_gutters">
878 <return type="void" />
879 <param index="0" name="from_line" type="int" />
880 <param index="1" name="to_line" type="int" />
881 <description>
882 Merge the gutters from [param from_line] into [param to_line]. Only overwritable gutters will be copied. See [method set_gutter_overwritable].
883 </description>
884 </method>
885 <method name="merge_overlapping_carets">
886 <return type="void" />
887 <description>
888 Merges any overlapping carets. Will favor the newest caret, or the caret with a selection.
889 If [method is_in_mulitcaret_edit] is [code]true[/code], the merge will be queued to happen at the end of the multicaret edit. See [method begin_multicaret_edit] and [method end_multicaret_edit].
890 [b]Note:[/b] This is not called when a caret changes position but after certain actions, so it is possible to get into a state where carets overlap.
891 </description>
892 </method>
893 <method name="multicaret_edit_ignore_caret" qualifiers="const">
894 <return type="bool" />
895 <param index="0" name="caret_index" type="int" />
896 <description>
897 Returns [code]true[/code] if the given [param caret_index] should be ignored as part of a multicaret edit. See [method begin_multicaret_edit] and [method end_multicaret_edit]. Carets that should be ignored are ones that were part of removed text and will likely be merged at the end of the edit, or carets that were added during the edit.
898 It is recommended to [code]continue[/code] within a loop iterating on multiple carets if a caret should be ignored.
899 </description>
900 </method>
901 <method name="paste">
902 <return type="void" />
903 <param index="0" name="caret_index" type="int" default="-1" />
904 <description>
905 Paste at the current location. Can be overridden with [method _paste].
906 </description>
907 </method>
908 <method name="paste_primary_clipboard">
909 <return type="void" />
910 <param index="0" name="caret_index" type="int" default="-1" />
911 <description>
912 Pastes the primary clipboard.
913 </description>
914 </method>
915 <method name="redo">
916 <return type="void" />
917 <description>
918 Perform redo operation.
919 </description>
920 </method>
921 <method name="remove_caret">
922 <return type="void" />
923 <param index="0" name="caret" type="int" />
924 <description>
925 Removes the given caret index.
926 [b]Note:[/b] This can result in adjustment of all other caret indices.
927 </description>
928 </method>
929 <method name="remove_gutter">
930 <return type="void" />
931 <param index="0" name="gutter" type="int" />
932 <description>
933 Removes the gutter at the given index.
934 </description>
935 </method>
936 <method name="remove_line_at">
937 <return type="void" />
938 <param index="0" name="line" type="int" />
939 <param index="1" name="move_carets_down" type="bool" default="true" />
940 <description>
941 Removes the line of text at [param line]. Carets on this line will attempt to match their previous visual x position.
942 If [param move_carets_down] is [code]true[/code] carets will move to the next line down, otherwise carets will move up.
943 </description>
944 </method>
945 <method name="remove_secondary_carets">
946 <return type="void" />
947 <description>
948 Removes all additional carets.
949 </description>
950 </method>
951 <method name="remove_text">
952 <return type="void" />
953 <param index="0" name="from_line" type="int" />
954 <param index="1" name="from_column" type="int" />
955 <param index="2" name="to_line" type="int" />
956 <param index="3" name="to_column" type="int" />
957 <description>
958 Removes text between the given positions.
959 </description>
960 </method>
961 <method name="search" qualifiers="const">
962 <return type="Vector2i" />
963 <param index="0" name="text" type="String" />
964 <param index="1" name="flags" type="int" />
965 <param index="2" name="from_line" type="int" />
966 <param index="3" name="from_column" type="int" />
967 <description>
968 Perform a search inside the text. Search flags can be specified in the [enum SearchFlags] enum.
969 In the returned vector, [code]x[/code] is the column, [code]y[/code] is the line. If no results are found, both are equal to [code]-1[/code].
970 [codeblocks]
971 [gdscript]
972 var result = search("print", SEARCH_WHOLE_WORDS, 0, 0)
973 if result.x != -1:
974 # Result found.
975 var line_number = result.y
976 var column_number = result.x
977 [/gdscript]
978 [csharp]
979 Vector2I result = Search("print", (uint)TextEdit.SearchFlags.WholeWords, 0, 0);
980 if (result.X != -1)
981 {
982 // Result found.
983 int lineNumber = result.Y;
984 int columnNumber = result.X;
985 }
986 [/csharp]
987 [/codeblocks]
988 </description>
989 </method>
990 <method name="select">
991 <return type="void" />
992 <param index="0" name="origin_line" type="int" />
993 <param index="1" name="origin_column" type="int" />
994 <param index="2" name="caret_line" type="int" />
995 <param index="3" name="caret_column" type="int" />
996 <param index="4" name="caret_index" type="int" default="0" />
997 <description>
998 Selects text from [param origin_line] and [param origin_column] to [param caret_line] and [param caret_column] for the given [param caret_index]. This moves the selection origin and the caret. If the positions are the same, the selection will be deselected.
999 If [member selecting_enabled] is [code]false[/code], no selection will occur.
1000 [b]Note:[/b] If supporting multiple carets this will not check for any overlap. See [method merge_overlapping_carets].
1001 </description>
1002 </method>
1003 <method name="select_all">
1004 <return type="void" />
1005 <description>
1006 Select all the text.
1007 If [member selecting_enabled] is [code]false[/code], no selection will occur.
1008 </description>
1009 </method>
1010 <method name="select_word_under_caret">
1011 <return type="void" />
1012 <param index="0" name="caret_index" type="int" default="-1" />
1013 <description>
1014 Selects the word under the caret.
1015 </description>
1016 </method>
1017 <method name="set_caret_column">
1018 <return type="void" />
1019 <param index="0" name="column" type="int" />
1020 <param index="1" name="adjust_viewport" type="bool" default="true" />
1021 <param index="2" name="caret_index" type="int" default="0" />
1022 <description>
1023 Moves the caret to the specified [param column] index.
1024 If [param adjust_viewport] is [code]true[/code], the viewport will center at the caret position after the move occurs.
1025 [b]Note:[/b] If supporting multiple carets this will not check for any overlap. See [method merge_overlapping_carets].
1026 </description>
1027 </method>
1028 <method name="set_caret_line">
1029 <return type="void" />
1030 <param index="0" name="line" type="int" />
1031 <param index="1" name="adjust_viewport" type="bool" default="true" />
1032 <param index="2" name="can_be_hidden" type="bool" default="true" />
1033 <param index="3" name="wrap_index" type="int" default="0" />
1034 <param index="4" name="caret_index" type="int" default="0" />
1035 <description>
1036 Moves the caret to the specified [param line] index. The caret column will be moved to the same visual position it was at the last time [method set_caret_column] was called, or clamped to the end of the line.
1037 If [param adjust_viewport] is [code]true[/code], the viewport will center at the caret position after the move occurs.
1038 If [param can_be_hidden] is [code]true[/code], the specified [param line] can be hidden.
1039 If [param wrap_index] is [code]-1[/code], the caret column will be clamped to the [param line]'s length. If [param wrap_index] is greater than [code]-1[/code], the column will be moved to attempt to match the visual x position on the line's [param wrap_index] to the position from the last time [method set_caret_column] was called.
1040 [b]Note:[/b] If supporting multiple carets this will not check for any overlap. See [method merge_overlapping_carets].
1041 </description>
1042 </method>
1043 <method name="set_gutter_clickable">
1044 <return type="void" />
1045 <param index="0" name="gutter" type="int" />
1046 <param index="1" name="clickable" type="bool" />
1047 <description>
1048 If [code]true[/code], the mouse cursor will change to a pointing hand ([constant Control.CURSOR_POINTING_HAND]) when hovering over the gutter at the given index. See [method is_gutter_clickable] and [method set_line_gutter_clickable].
1049 </description>
1050 </method>
1051 <method name="set_gutter_custom_draw">
1052 <return type="void" />
1053 <param index="0" name="column" type="int" />
1054 <param index="1" name="draw_callback" type="Callable" />
1055 <description>
1056 Set a custom draw callback for the gutter at the given index. [param draw_callback] must take the following arguments: A line index [int], a gutter index [int], and an area [Rect2]. This callback only works when the gutter type is [constant GUTTER_TYPE_CUSTOM] (see [method set_gutter_type]).
1057 </description>
1058 </method>
1059 <method name="set_gutter_draw">
1060 <return type="void" />
1061 <param index="0" name="gutter" type="int" />
1062 <param index="1" name="draw" type="bool" />
1063 <description>
1064 If [code]true[/code], the gutter at the given index is drawn. The gutter type ([method set_gutter_type]) determines how it is drawn. See [method is_gutter_drawn].
1065 </description>
1066 </method>
1067 <method name="set_gutter_name">
1068 <return type="void" />
1069 <param index="0" name="gutter" type="int" />
1070 <param index="1" name="name" type="String" />
1071 <description>
1072 Sets the name of the gutter at the given index.
1073 </description>
1074 </method>
1075 <method name="set_gutter_overwritable">
1076 <return type="void" />
1077 <param index="0" name="gutter" type="int" />
1078 <param index="1" name="overwritable" type="bool" />
1079 <description>
1080 If [code]true[/code], the line data of the gutter at the given index can be overridden when using [method merge_gutters]. See [method is_gutter_overwritable].
1081 </description>
1082 </method>
1083 <method name="set_gutter_type">
1084 <return type="void" />
1085 <param index="0" name="gutter" type="int" />
1086 <param index="1" name="type" type="int" enum="TextEdit.GutterType" />
1087 <description>
1088 Sets the type of gutter at the given index. Gutters can contain icons, text, or custom visuals.
1089 </description>
1090 </method>
1091 <method name="set_gutter_width">
1092 <return type="void" />
1093 <param index="0" name="gutter" type="int" />
1094 <param index="1" name="width" type="int" />
1095 <description>
1096 Set the width of the gutter at the given index.
1097 </description>
1098 </method>
1099 <method name="set_line">
1100 <return type="void" />
1101 <param index="0" name="line" type="int" />
1102 <param index="1" name="new_text" type="String" />
1103 <description>
1104 Sets the text for a specific [param line].
1105 Carets on the line will attempt to keep their visual x position.
1106 </description>
1107 </method>
1108 <method name="set_line_as_center_visible">
1109 <return type="void" />
1110 <param index="0" name="line" type="int" />
1111 <param index="1" name="wrap_index" type="int" default="0" />
1112 <description>
1113 Positions the [param wrap_index] of [param line] at the center of the viewport.
1114 </description>
1115 </method>
1116 <method name="set_line_as_first_visible">
1117 <return type="void" />
1118 <param index="0" name="line" type="int" />
1119 <param index="1" name="wrap_index" type="int" default="0" />
1120 <description>
1121 Positions the [param wrap_index] of [param line] at the top of the viewport.
1122 </description>
1123 </method>
1124 <method name="set_line_as_last_visible">
1125 <return type="void" />
1126 <param index="0" name="line" type="int" />
1127 <param index="1" name="wrap_index" type="int" default="0" />
1128 <description>
1129 Positions the [param wrap_index] of [param line] at the bottom of the viewport.
1130 </description>
1131 </method>
1132 <method name="set_line_background_color">
1133 <return type="void" />
1134 <param index="0" name="line" type="int" />
1135 <param index="1" name="color" type="Color" />
1136 <description>
1137 Sets the custom background color of the given line. If transparent, this color is applied on top of the default background color (See [theme_item background_color]). If set to [code]Color(0, 0, 0, 0)[/code], no additional color is applied.
1138 </description>
1139 </method>
1140 <method name="set_line_gutter_clickable">
1141 <return type="void" />
1142 <param index="0" name="line" type="int" />
1143 <param index="1" name="gutter" type="int" />
1144 <param index="2" name="clickable" type="bool" />
1145 <description>
1146 If [param clickable] is [code]true[/code], makes the [param gutter] on the given [param line] clickable. This is like [method set_gutter_clickable], but for a single line. If [method is_gutter_clickable] is [code]true[/code], this will not have any effect. See [method is_line_gutter_clickable] and [signal gutter_clicked].
1147 </description>
1148 </method>
1149 <method name="set_line_gutter_icon">
1150 <return type="void" />
1151 <param index="0" name="line" type="int" />
1152 <param index="1" name="gutter" type="int" />
1153 <param index="2" name="icon" type="Texture2D" />
1154 <description>
1155 Sets the icon for [param gutter] on [param line] to [param icon]. This only works when the gutter type is [constant GUTTER_TYPE_ICON] (see [method set_gutter_type]).
1156 </description>
1157 </method>
1158 <method name="set_line_gutter_item_color">
1159 <return type="void" />
1160 <param index="0" name="line" type="int" />
1161 <param index="1" name="gutter" type="int" />
1162 <param index="2" name="color" type="Color" />
1163 <description>
1164 Sets the color for [param gutter] on [param line] to [param color].
1165 </description>
1166 </method>
1167 <method name="set_line_gutter_metadata">
1168 <return type="void" />
1169 <param index="0" name="line" type="int" />
1170 <param index="1" name="gutter" type="int" />
1171 <param index="2" name="metadata" type="Variant" />
1172 <description>
1173 Sets the metadata for [param gutter] on [param line] to [param metadata].
1174 </description>
1175 </method>
1176 <method name="set_line_gutter_text">
1177 <return type="void" />
1178 <param index="0" name="line" type="int" />
1179 <param index="1" name="gutter" type="int" />
1180 <param index="2" name="text" type="String" />
1181 <description>
1182 Sets the text for [param gutter] on [param line] to [param text]. This only works when the gutter type is [constant GUTTER_TYPE_STRING] (see [method set_gutter_type]).
1183 </description>
1184 </method>
1185 <method name="set_overtype_mode_enabled">
1186 <return type="void" />
1187 <param index="0" name="enabled" type="bool" />
1188 <description>
1189 If [code]true[/code], enables overtype mode. In this mode, typing overrides existing text instead of inserting text. The [member ProjectSettings.input/ui_text_toggle_insert_mode] action toggles overtype mode. See [method is_overtype_mode_enabled].
1190 </description>
1191 </method>
1192 <method name="set_search_flags">
1193 <return type="void" />
1194 <param index="0" name="flags" type="int" />
1195 <description>
1196 Sets the search [param flags]. This is used with [method set_search_text] to highlight occurrences of the searched text. Search flags can be specified from the [enum SearchFlags] enum.
1197 </description>
1198 </method>
1199 <method name="set_search_text">
1200 <return type="void" />
1201 <param index="0" name="search_text" type="String" />
1202 <description>
1203 Sets the search text. See [method set_search_flags].
1204 </description>
1205 </method>
1206 <method name="set_selection_mode">
1207 <return type="void" />
1208 <param index="0" name="mode" type="int" enum="TextEdit.SelectionMode" />
1209 <description>
1210 Sets the current selection mode.
1211 </description>
1212 </method>
1213 <method name="set_selection_origin_column">
1214 <return type="void" />
1215 <param index="0" name="column" type="int" />
1216 <param index="1" name="caret_index" type="int" default="0" />
1217 <description>
1218 Sets the selection origin column to the [param column] for the given [param caret_index]. If the selection origin is moved to the caret position, the selection will deselect.
1219 </description>
1220 </method>
1221 <method name="set_selection_origin_line">
1222 <return type="void" />
1223 <param index="0" name="line" type="int" />
1224 <param index="1" name="can_be_hidden" type="bool" default="true" />
1225 <param index="2" name="wrap_index" type="int" default="-1" />
1226 <param index="3" name="caret_index" type="int" default="0" />
1227 <description>
1228 Sets the selection origin line to the [param line] for the given [param caret_index]. If the selection origin is moved to the caret position, the selection will deselect.
1229 If [param can_be_hidden] is [code]false[/code], The line will be set to the nearest unhidden line below or above.
1230 If [param wrap_index] is [code]-1[/code], the selection origin column will be clamped to the [param line]'s length. If [param wrap_index] is greater than [code]-1[/code], the column will be moved to attempt to match the visual x position on the line's [param wrap_index] to the position from the last time [method set_selection_origin_column] or [method select] was called.
1231 </description>
1232 </method>
1233 <method name="set_tab_size">
1234 <return type="void" />
1235 <param index="0" name="size" type="int" />
1236 <description>
1237 Sets the tab size for the [TextEdit] to use.
1238 </description>
1239 </method>
1240 <method name="set_tooltip_request_func">
1241 <return type="void" />
1242 <param index="0" name="callback" type="Callable" />
1243 <description>
1244 Provide custom tooltip text. The callback method must take the following args: [code]hovered_word: String[/code].
1245 </description>
1246 </method>
1247 <method name="skip_selection_for_next_occurrence">
1248 <return type="void" />
1249 <description>
1250 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.
1251 </description>
1252 </method>
1253 <method name="start_action">
1254 <return type="void" />
1255 <param index="0" name="action" type="int" enum="TextEdit.EditAction" />
1256 <description>
1257 Starts an action, will end the current action if [param action] is different.
1258 An action will also end after a call to [method end_action], after [member ProjectSettings.gui/timers/text_edit_idle_detect_sec] is triggered or a new undoable step outside the [method start_action] and [method end_action] calls.
1259 </description>
1260 </method>
1261 <method name="swap_lines">
1262 <return type="void" />
1263 <param index="0" name="from_line" type="int" />
1264 <param index="1" name="to_line" type="int" />
1265 <description>
1266 Swaps the two lines. Carets will be swapped with the lines.
1267 </description>
1268 </method>
1269 <method name="tag_saved_version">
1270 <return type="void" />
1271 <description>
1272 Tag the current version as saved.
1273 </description>
1274 </method>
1275 <method name="undo">
1276 <return type="void" />
1277 <description>
1278 Perform undo operation.
1279 </description>
1280 </method>
1281 </methods>
1282 <members>
1283 <member name="autowrap_mode" type="int" setter="set_autowrap_mode" getter="get_autowrap_mode" enum="TextServer.AutowrapMode" default="3">
1284 If [member wrap_mode] is set to [constant LINE_WRAPPING_BOUNDARY], sets text wrapping mode.
1285 </member>
1286 <member name="backspace_deletes_composite_character_enabled" type="bool" setter="set_backspace_deletes_composite_character_enabled" getter="is_backspace_deletes_composite_character_enabled" default="false">
1287 If [code]true[/code] and [member caret_mid_grapheme] is [code]false[/code], backspace deletes an entire composite character such as ❤️‍🩹, instead of deleting part of the composite character.
1288 </member>
1289 <member name="caret_blink" type="bool" setter="set_caret_blink_enabled" getter="is_caret_blink_enabled" default="false">
1290 If [code]true[/code], makes the caret blink.
1291 </member>
1292 <member name="caret_blink_interval" type="float" setter="set_caret_blink_interval" getter="get_caret_blink_interval" default="0.65">
1293 The interval at which the caret blinks (in seconds).
1294 </member>
1295 <member name="caret_draw_when_editable_disabled" type="bool" setter="set_draw_caret_when_editable_disabled" getter="is_drawing_caret_when_editable_disabled" default="false">
1296 If [code]true[/code], caret will be visible when [member editable] is disabled.
1297 </member>
1298 <member name="caret_mid_grapheme" type="bool" setter="set_caret_mid_grapheme_enabled" getter="is_caret_mid_grapheme_enabled" default="false">
1299 Allow moving caret, selecting and removing the individual composite character components.
1300 [b]Note:[/b] [kbd]Backspace[/kbd] is always removing individual composite character components.
1301 </member>
1302 <member name="caret_move_on_right_click" type="bool" setter="set_move_caret_on_right_click_enabled" getter="is_move_caret_on_right_click_enabled" default="true">
1303 If [code]true[/code], a right-click moves the caret at the mouse position before displaying the context menu.
1304 If [code]false[/code], the context menu ignores mouse location.
1305 </member>
1306 <member name="caret_multiple" type="bool" setter="set_multiple_carets_enabled" getter="is_multiple_carets_enabled" default="true">
1307 If [code]true[/code], multiple carets are allowed. Left-clicking with [kbd]Alt[/kbd] adds a new caret. See [method add_caret] and [method get_caret_count].
1308 </member>
1309 <member name="caret_type" type="int" setter="set_caret_type" getter="get_caret_type" enum="TextEdit.CaretType" default="0">
1310 Set the type of caret to draw.
1311 </member>
1312 <member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled" default="true">
1313 If [code]true[/code], a right-click displays the context menu.
1314 </member>
1315 <member name="custom_word_separators" type="String" setter="set_custom_word_separators" getter="get_custom_word_separators" default="&quot;&quot;">
1316 The characters to consider as word delimiters if [member use_custom_word_separators] is [code]true[/code]. The characters should be defined without separation, for example [code]#_![/code].
1317 </member>
1318 <member name="deselect_on_focus_loss_enabled" type="bool" setter="set_deselect_on_focus_loss_enabled" getter="is_deselect_on_focus_loss_enabled" default="true">
1319 If [code]true[/code], the selected text will be deselected when focus is lost.
1320 </member>
1321 <member name="drag_and_drop_selection_enabled" type="bool" setter="set_drag_and_drop_selection_enabled" getter="is_drag_and_drop_selection_enabled" default="true">
1322 If [code]true[/code], allow drag and drop of selected text. Text can still be dropped from other sources.
1323 </member>
1324 <member name="draw_control_chars" type="bool" setter="set_draw_control_chars" getter="get_draw_control_chars" default="false">
1325 If [code]true[/code], control characters are displayed.
1326 </member>
1327 <member name="draw_spaces" type="bool" setter="set_draw_spaces" getter="is_drawing_spaces" default="false">
1328 If [code]true[/code], the "space" character will have a visible representation.
1329 </member>
1330 <member name="draw_tabs" type="bool" setter="set_draw_tabs" getter="is_drawing_tabs" default="false">
1331 If [code]true[/code], the "tab" character will have a visible representation.
1332 </member>
1333 <member name="editable" type="bool" setter="set_editable" getter="is_editable" default="true" keywords="readonly, disabled, enabled">
1334 If [code]false[/code], existing text cannot be modified and new text cannot be added.
1335 </member>
1336 <member name="emoji_menu_enabled" type="bool" setter="set_emoji_menu_enabled" getter="is_emoji_menu_enabled" default="true">
1337 If [code]true[/code], "Emoji and Symbols" menu is enabled.
1338 </member>
1339 <member name="empty_selection_clipboard_enabled" type="bool" setter="set_empty_selection_clipboard_enabled" getter="is_empty_selection_clipboard_enabled" default="true">
1340 If [code]true[/code], copying or cutting without a selection is performed on all lines with a caret. Otherwise, copy and cut require a selection.
1341 </member>
1342 <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="2" />
1343 <member name="highlight_all_occurrences" type="bool" setter="set_highlight_all_occurrences" getter="is_highlight_all_occurrences_enabled" default="false">
1344 If [code]true[/code], all occurrences of the selected text will be highlighted.
1345 </member>
1346 <member name="highlight_current_line" type="bool" setter="set_highlight_current_line" getter="is_highlight_current_line_enabled" default="false">
1347 If [code]true[/code], the line containing the cursor is highlighted.
1348 </member>
1349 <member name="indent_wrapped_lines" type="bool" setter="set_indent_wrapped_lines" getter="is_indent_wrapped_lines" default="false">
1350 If [code]true[/code], all wrapped lines are indented to the same amount as the unwrapped line.
1351 </member>
1352 <member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
1353 Language code used for line-breaking and text shaping algorithms. If left empty, the current locale is used instead.
1354 </member>
1355 <member name="middle_mouse_paste_enabled" type="bool" setter="set_middle_mouse_paste_enabled" getter="is_middle_mouse_paste_enabled" default="true">
1356 If [code]false[/code], using middle mouse button to paste clipboard will be disabled.
1357 [b]Note:[/b] This method is only implemented on Linux.
1358 </member>
1359 <member name="minimap_draw" type="bool" setter="set_draw_minimap" getter="is_drawing_minimap" default="false">
1360 If [code]true[/code], a minimap is shown, providing an outline of your source code. The minimap uses a fixed-width text size.
1361 </member>
1362 <member name="minimap_width" type="int" setter="set_minimap_width" getter="get_minimap_width" default="80">
1363 The width, in pixels, of the minimap.
1364 </member>
1365 <member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" overrides="Control" enum="Control.CursorShape" default="1" />
1366 <member name="placeholder_text" type="String" setter="set_placeholder" getter="get_placeholder" default="&quot;&quot;">
1367 Text shown when the [TextEdit] is empty. It is [b]not[/b] the [TextEdit]'s default value (see [member text]).
1368 </member>
1369 <member name="scroll_fit_content_height" type="bool" setter="set_fit_content_height_enabled" getter="is_fit_content_height_enabled" default="false">
1370 If [code]true[/code], [TextEdit] will disable vertical scroll and fit minimum height to the number of visible lines. When both this property and [member scroll_fit_content_width] are [code]true[/code], no scrollbars will be displayed.
1371 </member>
1372 <member name="scroll_fit_content_width" type="bool" setter="set_fit_content_width_enabled" getter="is_fit_content_width_enabled" default="false">
1373 If [code]true[/code], [TextEdit] will disable horizontal scroll and fit minimum width to the widest line in the text. When both this property and [member scroll_fit_content_height] are [code]true[/code], no scrollbars will be displayed.
1374 </member>
1375 <member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0">
1376 If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels.
1377 </member>
1378 <member name="scroll_past_end_of_file" type="bool" setter="set_scroll_past_end_of_file_enabled" getter="is_scroll_past_end_of_file_enabled" default="false">
1379 Allow scrolling past the last line into "virtual" space.
1380 </member>
1381 <member name="scroll_smooth" type="bool" setter="set_smooth_scroll_enabled" getter="is_smooth_scroll_enabled" default="false">
1382 Scroll smoothly over the text rather than jumping to the next location.
1383 </member>
1384 <member name="scroll_v_scroll_speed" type="float" setter="set_v_scroll_speed" getter="get_v_scroll_speed" default="80.0">
1385 Sets the scroll speed with the minimap or when [member scroll_smooth] is enabled.
1386 </member>
1387 <member name="scroll_vertical" type="float" setter="set_v_scroll" getter="get_v_scroll" default="0.0">
1388 If there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line.
1389 </member>
1390 <member name="selecting_enabled" type="bool" setter="set_selecting_enabled" getter="is_selecting_enabled" default="true">
1391 If [code]true[/code], text can be selected.
1392 If [code]false[/code], text can not be selected by the user or by the [method select] or [method select_all] methods.
1393 </member>
1394 <member name="shortcut_keys_enabled" type="bool" setter="set_shortcut_keys_enabled" getter="is_shortcut_keys_enabled" default="true">
1395 If [code]true[/code], shortcut keys for context menu items are enabled, even if the context menu is disabled.
1396 </member>
1397 <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="TextServer.StructuredTextParser" default="0">
1398 Set BiDi algorithm override for the structured text.
1399 </member>
1400 <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[]">
1401 Set additional options for BiDi override.
1402 </member>
1403 <member name="syntax_highlighter" type="SyntaxHighlighter" setter="set_syntax_highlighter" getter="get_syntax_highlighter">
1404 The syntax highlighter to use.
1405 [b]Note:[/b] A [SyntaxHighlighter] instance should not be used across multiple [TextEdit] nodes.
1406 </member>
1407 <member name="tab_input_mode" type="bool" setter="set_tab_input_mode" getter="get_tab_input_mode" default="true">
1408 If [code]true[/code], [member ProjectSettings.input/ui_text_indent] input [code]Tab[/code] character, otherwise it moves keyboard focus to the next [Control] in the scene.
1409 </member>
1410 <member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
1411 String value of the [TextEdit].
1412 </member>
1413 <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
1414 Base text writing direction.
1415 </member>
1416 <member name="use_custom_word_separators" type="bool" setter="set_use_custom_word_separators" getter="is_custom_word_separators_enabled" default="false">
1417 If [code]false[/code], using [kbd]Ctrl + Left[/kbd] or [kbd]Ctrl + Right[/kbd] ([kbd]Cmd + Left[/kbd] or [kbd]Cmd + Right[/kbd] on macOS) bindings will use the behavior of [member use_default_word_separators]. If [code]true[/code], it will also stop the caret if a character within [member custom_word_separators] is detected. Useful for subword moving. This behavior also will be applied to the behavior of text selection.
1418 </member>
1419 <member name="use_default_word_separators" type="bool" setter="set_use_default_word_separators" getter="is_default_word_separators_enabled" default="true">
1420 If [code]false[/code], using [kbd]Ctrl + Left[/kbd] or [kbd]Ctrl + Right[/kbd] ([kbd]Cmd + Left[/kbd] or [kbd]Cmd + Right[/kbd] on macOS) bindings will stop moving caret only if a space or punctuation is detected. If [code]true[/code], it will also stop the caret if a character is part of [code]!"#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^`{|}~[/code], the Unicode General Punctuation table, or the Unicode CJK Punctuation table. Useful for subword moving. This behavior also will be applied to the behavior of text selection.
1421 </member>
1422 <member name="virtual_keyboard_enabled" type="bool" setter="set_virtual_keyboard_enabled" getter="is_virtual_keyboard_enabled" default="true">
1423 If [code]true[/code], the native virtual keyboard is enabled on platforms that support it.
1424 </member>
1425 <member name="virtual_keyboard_show_on_focus" type="bool" setter="set_virtual_keyboard_show_on_focus" getter="get_virtual_keyboard_show_on_focus" default="true">
1426 If [code]true[/code], the native virtual keyboard is shown on focus events on platforms that support it.
1427 </member>
1428 <member name="wrap_mode" type="int" setter="set_line_wrapping_mode" getter="get_line_wrapping_mode" enum="TextEdit.LineWrappingMode" default="0">
1429 Sets the line wrapping mode to use.
1430 </member>
1431 </members>
1432 <signals>
1433 <signal name="caret_changed">
1434 <description>
1435 Emitted when any caret changes position.
1436 </description>
1437 </signal>
1438 <signal name="gutter_added">
1439 <description>
1440 Emitted when a gutter is added.
1441 </description>
1442 </signal>
1443 <signal name="gutter_clicked">
1444 <param index="0" name="line" type="int" />
1445 <param index="1" name="gutter" type="int" />
1446 <description>
1447 Emitted when a gutter is clicked.
1448 </description>
1449 </signal>
1450 <signal name="gutter_removed">
1451 <description>
1452 Emitted when a gutter is removed.
1453 </description>
1454 </signal>
1455 <signal name="lines_edited_from">
1456 <param index="0" name="from_line" type="int" />
1457 <param index="1" name="to_line" type="int" />
1458 <description>
1459 Emitted immediately when the text changes.
1460 When text is added [param from_line] will be less than [param to_line]. On a remove [param to_line] will be less than [param from_line].
1461 </description>
1462 </signal>
1463 <signal name="text_changed">
1464 <description>
1465 Emitted when the text changes.
1466 </description>
1467 </signal>
1468 <signal name="text_set">
1469 <description>
1470 Emitted when [method clear] is called or [member text] is set.
1471 </description>
1472 </signal>
1473 </signals>
1474 <constants>
1475 <constant name="MENU_CUT" value="0" enum="MenuItems">
1476 Cuts (copies and clears) the selected text.
1477 </constant>
1478 <constant name="MENU_COPY" value="1" enum="MenuItems">
1479 Copies the selected text.
1480 </constant>
1481 <constant name="MENU_PASTE" value="2" enum="MenuItems">
1482 Pastes the clipboard text over the selected text (or at the cursor's position).
1483 </constant>
1484 <constant name="MENU_CLEAR" value="3" enum="MenuItems">
1485 Erases the whole [TextEdit] text.
1486 </constant>
1487 <constant name="MENU_SELECT_ALL" value="4" enum="MenuItems">
1488 Selects the whole [TextEdit] text.
1489 </constant>
1490 <constant name="MENU_UNDO" value="5" enum="MenuItems">
1491 Undoes the previous action.
1492 </constant>
1493 <constant name="MENU_REDO" value="6" enum="MenuItems">
1494 Redoes the previous action.
1495 </constant>
1496 <constant name="MENU_SUBMENU_TEXT_DIR" value="7" enum="MenuItems">
1497 ID of "Text Writing Direction" submenu.
1498 </constant>
1499 <constant name="MENU_DIR_INHERITED" value="8" enum="MenuItems">
1500 Sets text direction to inherited.
1501 </constant>
1502 <constant name="MENU_DIR_AUTO" value="9" enum="MenuItems">
1503 Sets text direction to automatic.
1504 </constant>
1505 <constant name="MENU_DIR_LTR" value="10" enum="MenuItems">
1506 Sets text direction to left-to-right.
1507 </constant>
1508 <constant name="MENU_DIR_RTL" value="11" enum="MenuItems">
1509 Sets text direction to right-to-left.
1510 </constant>
1511 <constant name="MENU_DISPLAY_UCC" value="12" enum="MenuItems">
1512 Toggles control character display.
1513 </constant>
1514 <constant name="MENU_SUBMENU_INSERT_UCC" value="13" enum="MenuItems">
1515 ID of "Insert Control Character" submenu.
1516 </constant>
1517 <constant name="MENU_INSERT_LRM" value="14" enum="MenuItems">
1518 Inserts left-to-right mark (LRM) character.
1519 </constant>
1520 <constant name="MENU_INSERT_RLM" value="15" enum="MenuItems">
1521 Inserts right-to-left mark (RLM) character.
1522 </constant>
1523 <constant name="MENU_INSERT_LRE" value="16" enum="MenuItems">
1524 Inserts start of left-to-right embedding (LRE) character.
1525 </constant>
1526 <constant name="MENU_INSERT_RLE" value="17" enum="MenuItems">
1527 Inserts start of right-to-left embedding (RLE) character.
1528 </constant>
1529 <constant name="MENU_INSERT_LRO" value="18" enum="MenuItems">
1530 Inserts start of left-to-right override (LRO) character.
1531 </constant>
1532 <constant name="MENU_INSERT_RLO" value="19" enum="MenuItems">
1533 Inserts start of right-to-left override (RLO) character.
1534 </constant>
1535 <constant name="MENU_INSERT_PDF" value="20" enum="MenuItems">
1536 Inserts pop direction formatting (PDF) character.
1537 </constant>
1538 <constant name="MENU_INSERT_ALM" value="21" enum="MenuItems">
1539 Inserts Arabic letter mark (ALM) character.
1540 </constant>
1541 <constant name="MENU_INSERT_LRI" value="22" enum="MenuItems">
1542 Inserts left-to-right isolate (LRI) character.
1543 </constant>
1544 <constant name="MENU_INSERT_RLI" value="23" enum="MenuItems">
1545 Inserts right-to-left isolate (RLI) character.
1546 </constant>
1547 <constant name="MENU_INSERT_FSI" value="24" enum="MenuItems">
1548 Inserts first strong isolate (FSI) character.
1549 </constant>
1550 <constant name="MENU_INSERT_PDI" value="25" enum="MenuItems">
1551 Inserts pop direction isolate (PDI) character.
1552 </constant>
1553 <constant name="MENU_INSERT_ZWJ" value="26" enum="MenuItems">
1554 Inserts zero width joiner (ZWJ) character.
1555 </constant>
1556 <constant name="MENU_INSERT_ZWNJ" value="27" enum="MenuItems">
1557 Inserts zero width non-joiner (ZWNJ) character.
1558 </constant>
1559 <constant name="MENU_INSERT_WJ" value="28" enum="MenuItems">
1560 Inserts word joiner (WJ) character.
1561 </constant>
1562 <constant name="MENU_INSERT_SHY" value="29" enum="MenuItems">
1563 Inserts soft hyphen (SHY) character.
1564 </constant>
1565 <constant name="MENU_EMOJI_AND_SYMBOL" value="30" enum="MenuItems">
1566 Opens system emoji and symbol picker.
1567 </constant>
1568 <constant name="MENU_MAX" value="31" enum="MenuItems">
1569 Represents the size of the [enum MenuItems] enum.
1570 </constant>
1571 <constant name="ACTION_NONE" value="0" enum="EditAction">
1572 No current action.
1573 </constant>
1574 <constant name="ACTION_TYPING" value="1" enum="EditAction">
1575 A typing action.
1576 </constant>
1577 <constant name="ACTION_BACKSPACE" value="2" enum="EditAction">
1578 A backwards delete action.
1579 </constant>
1580 <constant name="ACTION_DELETE" value="3" enum="EditAction">
1581 A forward delete action.
1582 </constant>
1583 <constant name="SEARCH_MATCH_CASE" value="1" enum="SearchFlags">
1584 Match case when searching.
1585 </constant>
1586 <constant name="SEARCH_WHOLE_WORDS" value="2" enum="SearchFlags">
1587 Match whole words when searching.
1588 </constant>
1589 <constant name="SEARCH_BACKWARDS" value="4" enum="SearchFlags">
1590 Search from end to beginning.
1591 </constant>
1592 <constant name="CARET_TYPE_LINE" value="0" enum="CaretType">
1593 Vertical line caret.
1594 </constant>
1595 <constant name="CARET_TYPE_BLOCK" value="1" enum="CaretType">
1596 Block caret.
1597 </constant>
1598 <constant name="SELECTION_MODE_NONE" value="0" enum="SelectionMode">
1599 Not selecting.
1600 </constant>
1601 <constant name="SELECTION_MODE_SHIFT" value="1" enum="SelectionMode">
1602 Select as if [code]shift[/code] is pressed.
1603 </constant>
1604 <constant name="SELECTION_MODE_POINTER" value="2" enum="SelectionMode">
1605 Select single characters as if the user single clicked.
1606 </constant>
1607 <constant name="SELECTION_MODE_WORD" value="3" enum="SelectionMode">
1608 Select whole words as if the user double clicked.
1609 </constant>
1610 <constant name="SELECTION_MODE_LINE" value="4" enum="SelectionMode">
1611 Select whole lines as if the user triple clicked.
1612 </constant>
1613 <constant name="LINE_WRAPPING_NONE" value="0" enum="LineWrappingMode">
1614 Line wrapping is disabled.
1615 </constant>
1616 <constant name="LINE_WRAPPING_BOUNDARY" value="1" enum="LineWrappingMode">
1617 Line wrapping occurs at the control boundary, beyond what would normally be visible.
1618 </constant>
1619 <constant name="GUTTER_TYPE_STRING" value="0" enum="GutterType">
1620 When a gutter is set to string using [method set_gutter_type], it is used to contain text set via the [method set_line_gutter_text] method.
1621 </constant>
1622 <constant name="GUTTER_TYPE_ICON" value="1" enum="GutterType">
1623 When a gutter is set to icon using [method set_gutter_type], it is used to contain an icon set via the [method set_line_gutter_icon] method.
1624 </constant>
1625 <constant name="GUTTER_TYPE_CUSTOM" value="2" enum="GutterType">
1626 When a gutter is set to custom using [method set_gutter_type], it is used to contain custom visuals controlled by a callback method set via the [method set_gutter_custom_draw] method.
1627 </constant>
1628 </constants>
1629 <theme_items>
1630 <theme_item name="background_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)" deprecated="Assign a [StyleBoxFlat] to [theme_item normal] instead, and set [member StyleBoxFlat.bg_color] to the desired background color.">
1631 Sets the background [Color] of this [TextEdit].
1632 </theme_item>
1633 <theme_item name="caret_background_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)">
1634 [Color] of the text behind the caret when using a block caret.
1635 </theme_item>
1636 <theme_item name="caret_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
1637 [Color] of the caret. This can be set to a fully transparent color to hide the caret entirely.
1638 </theme_item>
1639 <theme_item name="current_line_color" data_type="color" type="Color" default="Color(0.25, 0.25, 0.26, 0.8)">
1640 Background [Color] of the line containing the caret.
1641 </theme_item>
1642 <theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
1643 Sets the font [Color].
1644 </theme_item>
1645 <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)">
1646 The tint of text outline of the [TextEdit].
1647 </theme_item>
1648 <theme_item name="font_placeholder_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.6)">
1649 Font color for [member placeholder_text].
1650 </theme_item>
1651 <theme_item name="font_readonly_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)">
1652 Sets the font [Color] when [member editable] is disabled.
1653 </theme_item>
1654 <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)">
1655 Sets the [Color] of the selected text. If equal to [code]Color(0, 0, 0, 0)[/code], it will be ignored.
1656 </theme_item>
1657 <theme_item name="search_result_border_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 0.4)">
1658 [Color] of the border around text that matches the search query.
1659 </theme_item>
1660 <theme_item name="search_result_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 1)">
1661 [Color] behind the text that matches the search query.
1662 </theme_item>
1663 <theme_item name="selection_color" data_type="color" type="Color" default="Color(0.5, 0.5, 0.5, 1)">
1664 Sets the highlight [Color] of text selections.
1665 </theme_item>
1666 <theme_item name="word_highlighted_color" data_type="color" type="Color" default="Color(0.5, 0.5, 0.5, 0.25)">
1667 Sets the highlight [Color] of multiple occurrences. [member highlight_all_occurrences] has to be enabled.
1668 </theme_item>
1669 <theme_item name="caret_width" data_type="constant" type="int" default="1">
1670 The caret's width in pixels. Greater values can be used to improve accessibility by ensuring the caret is easily visible, or to ensure consistency with a large font size. If set to [code]0[/code] or lower, the caret width is automatically set to 1 pixel and multiplied by the display scaling factor.
1671 </theme_item>
1672 <theme_item name="line_spacing" data_type="constant" type="int" default="4">
1673 Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
1674 </theme_item>
1675 <theme_item name="outline_size" data_type="constant" type="int" default="0">
1676 The size of the text outline.
1677 [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
1678 </theme_item>
1679 <theme_item name="wrap_offset" data_type="constant" type="int" default="10">
1680 Sets an additional margin for line wrapping width.
1681 </theme_item>
1682 <theme_item name="font" data_type="font" type="Font">
1683 Sets the default [Font].
1684 </theme_item>
1685 <theme_item name="font_size" data_type="font_size" type="int">
1686 Sets default font size.
1687 </theme_item>
1688 <theme_item name="space" data_type="icon" type="Texture2D">
1689 Sets a custom [Texture2D] for space text characters.
1690 </theme_item>
1691 <theme_item name="tab" data_type="icon" type="Texture2D">
1692 Sets a custom [Texture2D] for tab text characters.
1693 </theme_item>
1694 <theme_item name="focus" data_type="style" type="StyleBox">
1695 Sets the [StyleBox] when in focus. The [theme_item focus] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
1696 </theme_item>
1697 <theme_item name="normal" data_type="style" type="StyleBox">
1698 Sets the [StyleBox] of this [TextEdit].
1699 </theme_item>
1700 <theme_item name="read_only" data_type="style" type="StyleBox" keywords="enabled, disabled, editable">
1701 Sets the [StyleBox] of this [TextEdit] when [member editable] is disabled.
1702 </theme_item>
1703 </theme_items>
1704 </class>