class_textedit.rst 158 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the TextEdit.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_TextEdit:
  6. TextEdit
  7. ========
  8. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`CodeEdit<class_CodeEdit>`
  10. Multiline text editing control.
  11. Description
  12. -----------
  13. TextEdit is meant for editing large, multiline text. It also has facilities for editing code, such as syntax highlighting support and multiple levels of undo/redo.
  14. \ **Note:** When holding down :kbd:`Alt`, the vertical scroll wheel will scroll 5 times as fast as it would normally do. This also works in the Godot script editor.
  15. Properties
  16. ----------
  17. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`caret_blink<class_TextEdit_property_caret_blink>` | ``false`` |
  19. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`caret_blink_speed<class_TextEdit_property_caret_blink_speed>` | ``0.65`` |
  21. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  22. | :ref:`bool<class_bool>` | :ref:`caret_mid_grapheme<class_TextEdit_property_caret_mid_grapheme>` | ``true`` |
  23. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`caret_move_on_right_click<class_TextEdit_property_caret_move_on_right_click>` | ``true`` |
  25. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  26. | :ref:`CaretType<enum_TextEdit_CaretType>` | :ref:`caret_type<class_TextEdit_property_caret_type>` | ``0`` |
  27. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_TextEdit_property_context_menu_enabled>` | ``true`` |
  29. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`deselect_on_focus_loss_enabled<class_TextEdit_property_deselect_on_focus_loss_enabled>` | ``true`` |
  31. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`draw_control_chars<class_TextEdit_property_draw_control_chars>` | ``false`` |
  33. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  34. | :ref:`bool<class_bool>` | :ref:`draw_spaces<class_TextEdit_property_draw_spaces>` | ``false`` |
  35. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  36. | :ref:`bool<class_bool>` | :ref:`draw_tabs<class_TextEdit_property_draw_tabs>` | ``false`` |
  37. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  38. | :ref:`bool<class_bool>` | :ref:`editable<class_TextEdit_property_editable>` | ``true`` |
  39. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  40. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  41. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` | ``false`` |
  43. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  44. | :ref:`bool<class_bool>` | :ref:`highlight_current_line<class_TextEdit_property_highlight_current_line>` | ``false`` |
  45. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  46. | :ref:`String<class_String>` | :ref:`language<class_TextEdit_property_language>` | ``""`` |
  47. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  48. | :ref:`bool<class_bool>` | :ref:`middle_mouse_paste_enabled<class_TextEdit_property_middle_mouse_paste_enabled>` | ``true`` |
  49. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  50. | :ref:`bool<class_bool>` | :ref:`minimap_draw<class_TextEdit_property_minimap_draw>` | ``false`` |
  51. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  52. | :ref:`int<class_int>` | :ref:`minimap_width<class_TextEdit_property_minimap_width>` | ``80`` |
  53. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  54. | :ref:`CursorShape<enum_Control_CursorShape>` | mouse_default_cursor_shape | ``1`` (overrides :ref:`Control<class_Control_property_mouse_default_cursor_shape>`) |
  55. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  56. | :ref:`bool<class_bool>` | :ref:`override_selected_font_color<class_TextEdit_property_override_selected_font_color>` | ``false`` |
  57. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  58. | :ref:`String<class_String>` | :ref:`placeholder_text<class_TextEdit_property_placeholder_text>` | ``""`` |
  59. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  60. | :ref:`int<class_int>` | :ref:`scroll_horizontal<class_TextEdit_property_scroll_horizontal>` | ``0`` |
  61. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`scroll_past_end_of_file<class_TextEdit_property_scroll_past_end_of_file>` | ``false`` |
  63. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`scroll_smooth<class_TextEdit_property_scroll_smooth>` | ``false`` |
  65. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  66. | :ref:`float<class_float>` | :ref:`scroll_v_scroll_speed<class_TextEdit_property_scroll_v_scroll_speed>` | ``80.0`` |
  67. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  68. | :ref:`float<class_float>` | :ref:`scroll_vertical<class_TextEdit_property_scroll_vertical>` | ``0.0`` |
  69. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  70. | :ref:`bool<class_bool>` | :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` | ``true`` |
  71. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  72. | :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_TextEdit_property_shortcut_keys_enabled>` | ``true`` |
  73. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  74. | :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_TextEdit_property_structured_text_bidi_override>` | ``0`` |
  75. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  76. | :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_TextEdit_property_structured_text_bidi_override_options>` | ``[]`` |
  77. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  78. | :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` | :ref:`syntax_highlighter<class_TextEdit_property_syntax_highlighter>` | |
  79. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  80. | :ref:`String<class_String>` | :ref:`text<class_TextEdit_property_text>` | ``""`` |
  81. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  82. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_TextEdit_property_text_direction>` | ``0`` |
  83. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  84. | :ref:`bool<class_bool>` | :ref:`virtual_keyboard_enabled<class_TextEdit_property_virtual_keyboard_enabled>` | ``true`` |
  85. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  86. | :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` | :ref:`wrap_mode<class_TextEdit_property_wrap_mode>` | ``0`` |
  87. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  88. Methods
  89. -------
  90. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`_backspace<class_TextEdit_method__backspace>` **(** **)** |virtual| |
  92. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`_copy<class_TextEdit_method__copy>` **(** **)** |virtual| |
  94. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`_cut<class_TextEdit_method__cut>` **(** **)** |virtual| |
  96. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`_handle_unicode_input<class_TextEdit_method__handle_unicode_input>` **(** :ref:`int<class_int>` unicode_char **)** |virtual| |
  98. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`_paste<class_TextEdit_method__paste>` **(** **)** |virtual| |
  100. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`_paste_primary_clipboard<class_TextEdit_method__paste_primary_clipboard>` **(** **)** |virtual| |
  102. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`add_gutter<class_TextEdit_method_add_gutter>` **(** :ref:`int<class_int>` at=-1 **)** |
  104. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | void | :ref:`adjust_viewport_to_caret<class_TextEdit_method_adjust_viewport_to_caret>` **(** **)** |
  106. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | void | :ref:`backspace<class_TextEdit_method_backspace>` **(** **)** |
  108. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | void | :ref:`begin_complex_operation<class_TextEdit_method_begin_complex_operation>` **(** **)** |
  110. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | void | :ref:`center_viewport_to_caret<class_TextEdit_method_center_viewport_to_caret>` **(** **)** |
  112. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | void | :ref:`clear<class_TextEdit_method_clear>` **(** **)** |
  114. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | void | :ref:`clear_opentype_features<class_TextEdit_method_clear_opentype_features>` **(** **)** |
  116. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | void | :ref:`clear_undo_history<class_TextEdit_method_clear_undo_history>` **(** **)** |
  118. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | void | :ref:`copy<class_TextEdit_method_copy>` **(** **)** |
  120. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | void | :ref:`cut<class_TextEdit_method_cut>` **(** **)** |
  122. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | void | :ref:`delete_selection<class_TextEdit_method_delete_selection>` **(** **)** |
  124. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | void | :ref:`deselect<class_TextEdit_method_deselect>` **(** **)** |
  126. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | void | :ref:`end_complex_operation<class_TextEdit_method_end_complex_operation>` **(** **)** |
  128. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`int<class_int>` | :ref:`get_caret_column<class_TextEdit_method_get_caret_column>` **(** **)** |const| |
  130. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`Vector2<class_Vector2>` | :ref:`get_caret_draw_pos<class_TextEdit_method_get_caret_draw_pos>` **(** **)** |const| |
  132. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`int<class_int>` | :ref:`get_caret_line<class_TextEdit_method_get_caret_line>` **(** **)** |const| |
  134. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`int<class_int>` | :ref:`get_caret_wrap_index<class_TextEdit_method_get_caret_wrap_index>` **(** **)** |const| |
  136. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | :ref:`int<class_int>` | :ref:`get_first_non_whitespace_column<class_TextEdit_method_get_first_non_whitespace_column>` **(** :ref:`int<class_int>` line **)** |const| |
  138. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | :ref:`int<class_int>` | :ref:`get_first_visible_line<class_TextEdit_method_get_first_visible_line>` **(** **)** |const| |
  140. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | :ref:`int<class_int>` | :ref:`get_gutter_count<class_TextEdit_method_get_gutter_count>` **(** **)** |const| |
  142. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :ref:`String<class_String>` | :ref:`get_gutter_name<class_TextEdit_method_get_gutter_name>` **(** :ref:`int<class_int>` gutter **)** |const| |
  144. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`GutterType<enum_TextEdit_GutterType>` | :ref:`get_gutter_type<class_TextEdit_method_get_gutter_type>` **(** :ref:`int<class_int>` gutter **)** |const| |
  146. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`int<class_int>` | :ref:`get_gutter_width<class_TextEdit_method_get_gutter_width>` **(** :ref:`int<class_int>` gutter **)** |const| |
  148. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`int<class_int>` | :ref:`get_indent_level<class_TextEdit_method_get_indent_level>` **(** :ref:`int<class_int>` line **)** |const| |
  150. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :ref:`int<class_int>` | :ref:`get_last_full_visible_line<class_TextEdit_method_get_last_full_visible_line>` **(** **)** |const| |
  152. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | :ref:`int<class_int>` | :ref:`get_last_full_visible_line_wrap_index<class_TextEdit_method_get_last_full_visible_line_wrap_index>` **(** **)** |const| |
  154. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | :ref:`int<class_int>` | :ref:`get_last_unhidden_line<class_TextEdit_method_get_last_unhidden_line>` **(** **)** |const| |
  156. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | :ref:`String<class_String>` | :ref:`get_line<class_TextEdit_method_get_line>` **(** :ref:`int<class_int>` line **)** |const| |
  158. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | :ref:`Color<class_Color>` | :ref:`get_line_background_color<class_TextEdit_method_get_line_background_color>` **(** :ref:`int<class_int>` line **)** |const| |
  160. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_line_column_at_pos<class_TextEdit_method_get_line_column_at_pos>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`bool<class_bool>` allow_out_of_bounds=true **)** |const| |
  162. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | :ref:`int<class_int>` | :ref:`get_line_count<class_TextEdit_method_get_line_count>` **(** **)** |const| |
  164. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_line_gutter_icon<class_TextEdit_method_get_line_gutter_icon>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
  166. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | :ref:`Color<class_Color>` | :ref:`get_line_gutter_item_color<class_TextEdit_method_get_line_gutter_item_color>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
  168. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | :ref:`Variant<class_Variant>` | :ref:`get_line_gutter_metadata<class_TextEdit_method_get_line_gutter_metadata>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
  170. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | :ref:`String<class_String>` | :ref:`get_line_gutter_text<class_TextEdit_method_get_line_gutter_text>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
  172. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | :ref:`int<class_int>` | :ref:`get_line_height<class_TextEdit_method_get_line_height>` **(** **)** |const| |
  174. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | :ref:`int<class_int>` | :ref:`get_line_width<class_TextEdit_method_get_line_width>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=-1 **)** |const| |
  176. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | :ref:`int<class_int>` | :ref:`get_line_wrap_count<class_TextEdit_method_get_line_wrap_count>` **(** :ref:`int<class_int>` line **)** |const| |
  178. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | :ref:`int<class_int>` | :ref:`get_line_wrap_index_at_column<class_TextEdit_method_get_line_wrap_index_at_column>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const| |
  180. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_line_wrapped_text<class_TextEdit_method_get_line_wrapped_text>` **(** :ref:`int<class_int>` line **)** |const| |
  182. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | :ref:`Vector2<class_Vector2>` | :ref:`get_local_mouse_pos<class_TextEdit_method_get_local_mouse_pos>` **(** **)** |const| |
  184. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_TextEdit_method_get_menu>` **(** **)** |const| |
  186. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | :ref:`int<class_int>` | :ref:`get_minimap_line_at_pos<class_TextEdit_method_get_minimap_line_at_pos>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
  188. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. | :ref:`int<class_int>` | :ref:`get_minimap_visible_lines<class_TextEdit_method_get_minimap_visible_lines>` **(** **)** |const| |
  190. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  191. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_next_visible_line_index_offset_from<class_TextEdit_method_get_next_visible_line_index_offset_from>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index, :ref:`int<class_int>` visible_amount **)** |const| |
  192. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  193. | :ref:`int<class_int>` | :ref:`get_next_visible_line_offset_from<class_TextEdit_method_get_next_visible_line_offset_from>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` visible_amount **)** |const| |
  194. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  195. | :ref:`int<class_int>` | :ref:`get_opentype_feature<class_TextEdit_method_get_opentype_feature>` **(** :ref:`String<class_String>` tag **)** |const| |
  196. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  197. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_pos_at_line_column<class_TextEdit_method_get_pos_at_line_column>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const| |
  198. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  199. | :ref:`Rect2i<class_Rect2i>` | :ref:`get_rect_at_line_column<class_TextEdit_method_get_rect_at_line_column>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const| |
  200. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  201. | :ref:`int<class_int>` | :ref:`get_saved_version<class_TextEdit_method_get_saved_version>` **(** **)** |const| |
  202. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  203. | :ref:`float<class_float>` | :ref:`get_scroll_pos_for_line<class_TextEdit_method_get_scroll_pos_for_line>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |const| |
  204. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  205. | :ref:`String<class_String>` | :ref:`get_selected_text<class_TextEdit_method_get_selected_text>` **(** **)** |const| |
  206. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  207. | :ref:`int<class_int>` | :ref:`get_selection_column<class_TextEdit_method_get_selection_column>` **(** **)** |const| |
  208. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  209. | :ref:`int<class_int>` | :ref:`get_selection_from_column<class_TextEdit_method_get_selection_from_column>` **(** **)** |const| |
  210. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  211. | :ref:`int<class_int>` | :ref:`get_selection_from_line<class_TextEdit_method_get_selection_from_line>` **(** **)** |const| |
  212. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  213. | :ref:`int<class_int>` | :ref:`get_selection_line<class_TextEdit_method_get_selection_line>` **(** **)** |const| |
  214. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  215. | :ref:`SelectionMode<enum_TextEdit_SelectionMode>` | :ref:`get_selection_mode<class_TextEdit_method_get_selection_mode>` **(** **)** |const| |
  216. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  217. | :ref:`int<class_int>` | :ref:`get_selection_to_column<class_TextEdit_method_get_selection_to_column>` **(** **)** |const| |
  218. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  219. | :ref:`int<class_int>` | :ref:`get_selection_to_line<class_TextEdit_method_get_selection_to_line>` **(** **)** |const| |
  220. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  221. | :ref:`int<class_int>` | :ref:`get_tab_size<class_TextEdit_method_get_tab_size>` **(** **)** |const| |
  222. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  223. | :ref:`int<class_int>` | :ref:`get_total_gutter_width<class_TextEdit_method_get_total_gutter_width>` **(** **)** |const| |
  224. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  225. | :ref:`int<class_int>` | :ref:`get_total_visible_line_count<class_TextEdit_method_get_total_visible_line_count>` **(** **)** |const| |
  226. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  227. | :ref:`int<class_int>` | :ref:`get_version<class_TextEdit_method_get_version>` **(** **)** |const| |
  228. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  229. | :ref:`int<class_int>` | :ref:`get_visible_line_count<class_TextEdit_method_get_visible_line_count>` **(** **)** |const| |
  230. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  231. | :ref:`int<class_int>` | :ref:`get_visible_line_count_in_range<class_TextEdit_method_get_visible_line_count_in_range>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)** |const| |
  232. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  233. | :ref:`String<class_String>` | :ref:`get_word_at_pos<class_TextEdit_method_get_word_at_pos>` **(** :ref:`Vector2<class_Vector2>` position **)** |const| |
  234. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  235. | :ref:`String<class_String>` | :ref:`get_word_under_caret<class_TextEdit_method_get_word_under_caret>` **(** **)** |const| |
  236. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  237. | :ref:`bool<class_bool>` | :ref:`has_ime_text<class_TextEdit_method_has_ime_text>` **(** **)** |const| |
  238. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  239. | :ref:`bool<class_bool>` | :ref:`has_redo<class_TextEdit_method_has_redo>` **(** **)** |const| |
  240. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  241. | :ref:`bool<class_bool>` | :ref:`has_selection<class_TextEdit_method_has_selection>` **(** **)** |const| |
  242. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  243. | :ref:`bool<class_bool>` | :ref:`has_undo<class_TextEdit_method_has_undo>` **(** **)** |const| |
  244. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  245. | void | :ref:`insert_line_at<class_TextEdit_method_insert_line_at>` **(** :ref:`int<class_int>` line, :ref:`String<class_String>` text **)** |
  246. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  247. | void | :ref:`insert_text_at_caret<class_TextEdit_method_insert_text_at_caret>` **(** :ref:`String<class_String>` text **)** |
  248. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  249. | :ref:`bool<class_bool>` | :ref:`is_caret_visible<class_TextEdit_method_is_caret_visible>` **(** **)** |const| |
  250. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  251. | :ref:`bool<class_bool>` | :ref:`is_dragging_cursor<class_TextEdit_method_is_dragging_cursor>` **(** **)** |const| |
  252. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  253. | :ref:`bool<class_bool>` | :ref:`is_gutter_clickable<class_TextEdit_method_is_gutter_clickable>` **(** :ref:`int<class_int>` gutter **)** |const| |
  254. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  255. | :ref:`bool<class_bool>` | :ref:`is_gutter_drawn<class_TextEdit_method_is_gutter_drawn>` **(** :ref:`int<class_int>` gutter **)** |const| |
  256. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  257. | :ref:`bool<class_bool>` | :ref:`is_gutter_overwritable<class_TextEdit_method_is_gutter_overwritable>` **(** :ref:`int<class_int>` gutter **)** |const| |
  258. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  259. | :ref:`bool<class_bool>` | :ref:`is_line_gutter_clickable<class_TextEdit_method_is_line_gutter_clickable>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
  260. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  261. | :ref:`bool<class_bool>` | :ref:`is_line_wrapped<class_TextEdit_method_is_line_wrapped>` **(** :ref:`int<class_int>` line **)** |const| |
  262. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  263. | :ref:`bool<class_bool>` | :ref:`is_menu_visible<class_TextEdit_method_is_menu_visible>` **(** **)** |const| |
  264. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  265. | :ref:`bool<class_bool>` | :ref:`is_mouse_over_selection<class_TextEdit_method_is_mouse_over_selection>` **(** :ref:`bool<class_bool>` edges **)** |const| |
  266. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  267. | :ref:`bool<class_bool>` | :ref:`is_overtype_mode_enabled<class_TextEdit_method_is_overtype_mode_enabled>` **(** **)** |const| |
  268. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  269. | void | :ref:`menu_option<class_TextEdit_method_menu_option>` **(** :ref:`int<class_int>` option **)** |
  270. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  271. | void | :ref:`merge_gutters<class_TextEdit_method_merge_gutters>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)** |
  272. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  273. | void | :ref:`paste<class_TextEdit_method_paste>` **(** **)** |
  274. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  275. | void | :ref:`redo<class_TextEdit_method_redo>` **(** **)** |
  276. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  277. | void | :ref:`remove_gutter<class_TextEdit_method_remove_gutter>` **(** :ref:`int<class_int>` gutter **)** |
  278. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  279. | void | :ref:`remove_text<class_TextEdit_method_remove_text>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_column **)** |
  280. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  281. | :ref:`Vector2i<class_Vector2i>` | :ref:`search<class_TextEdit_method_search>` **(** :ref:`String<class_String>` text, :ref:`int<class_int>` flags, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_colum **)** |const| |
  282. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  283. | void | :ref:`select<class_TextEdit_method_select>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_column **)** |
  284. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  285. | void | :ref:`select_all<class_TextEdit_method_select_all>` **(** **)** |
  286. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  287. | void | :ref:`select_word_under_caret<class_TextEdit_method_select_word_under_caret>` **(** **)** |
  288. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  289. | void | :ref:`set_caret_column<class_TextEdit_method_set_caret_column>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)** |
  290. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  291. | void | :ref:`set_caret_line<class_TextEdit_method_set_caret_line>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` adjust_viewport=true, :ref:`bool<class_bool>` can_be_hidden=true, :ref:`int<class_int>` wrap_index=0 **)** |
  292. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  293. | void | :ref:`set_gutter_clickable<class_TextEdit_method_set_gutter_clickable>` **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` clickable **)** |
  294. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  295. | void | :ref:`set_gutter_custom_draw<class_TextEdit_method_set_gutter_custom_draw>` **(** :ref:`int<class_int>` column, :ref:`Callable<class_Callable>` draw_callback **)** |
  296. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  297. | void | :ref:`set_gutter_draw<class_TextEdit_method_set_gutter_draw>` **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` draw **)** |
  298. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  299. | void | :ref:`set_gutter_name<class_TextEdit_method_set_gutter_name>` **(** :ref:`int<class_int>` gutter, :ref:`String<class_String>` name **)** |
  300. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  301. | void | :ref:`set_gutter_overwritable<class_TextEdit_method_set_gutter_overwritable>` **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` overwritable **)** |
  302. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  303. | void | :ref:`set_gutter_type<class_TextEdit_method_set_gutter_type>` **(** :ref:`int<class_int>` gutter, :ref:`GutterType<enum_TextEdit_GutterType>` type **)** |
  304. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  305. | void | :ref:`set_gutter_width<class_TextEdit_method_set_gutter_width>` **(** :ref:`int<class_int>` gutter, :ref:`int<class_int>` width **)** |
  306. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  307. | void | :ref:`set_line<class_TextEdit_method_set_line>` **(** :ref:`int<class_int>` line, :ref:`String<class_String>` new_text **)** |
  308. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  309. | void | :ref:`set_line_as_center_visible<class_TextEdit_method_set_line_as_center_visible>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |
  310. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  311. | void | :ref:`set_line_as_first_visible<class_TextEdit_method_set_line_as_first_visible>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |
  312. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  313. | void | :ref:`set_line_as_last_visible<class_TextEdit_method_set_line_as_last_visible>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |
  314. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  315. | void | :ref:`set_line_background_color<class_TextEdit_method_set_line_background_color>` **(** :ref:`int<class_int>` line, :ref:`Color<class_Color>` color **)** |
  316. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  317. | void | :ref:`set_line_gutter_clickable<class_TextEdit_method_set_line_gutter_clickable>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` clickable **)** |
  318. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  319. | void | :ref:`set_line_gutter_icon<class_TextEdit_method_set_line_gutter_icon>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Texture2D<class_Texture2D>` icon **)** |
  320. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  321. | void | :ref:`set_line_gutter_item_color<class_TextEdit_method_set_line_gutter_item_color>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Color<class_Color>` color **)** |
  322. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  323. | void | :ref:`set_line_gutter_metadata<class_TextEdit_method_set_line_gutter_metadata>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Variant<class_Variant>` metadata **)** |
  324. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  325. | void | :ref:`set_line_gutter_text<class_TextEdit_method_set_line_gutter_text>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`String<class_String>` text **)** |
  326. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  327. | void | :ref:`set_opentype_feature<class_TextEdit_method_set_opentype_feature>` **(** :ref:`String<class_String>` tag, :ref:`int<class_int>` value **)** |
  328. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  329. | void | :ref:`set_overtype_mode_enabled<class_TextEdit_method_set_overtype_mode_enabled>` **(** :ref:`bool<class_bool>` enabled **)** |
  330. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  331. | void | :ref:`set_search_flags<class_TextEdit_method_set_search_flags>` **(** :ref:`int<class_int>` flags **)** |
  332. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  333. | void | :ref:`set_search_text<class_TextEdit_method_set_search_text>` **(** :ref:`String<class_String>` search_text **)** |
  334. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  335. | void | :ref:`set_selection_mode<class_TextEdit_method_set_selection_mode>` **(** :ref:`SelectionMode<enum_TextEdit_SelectionMode>` mode, :ref:`int<class_int>` line=-1, :ref:`int<class_int>` column=-1 **)** |
  336. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  337. | void | :ref:`set_tab_size<class_TextEdit_method_set_tab_size>` **(** :ref:`int<class_int>` size **)** |
  338. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  339. | void | :ref:`set_tooltip_request_func<class_TextEdit_method_set_tooltip_request_func>` **(** :ref:`Callable<class_Callable>` callback **)** |
  340. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  341. | void | :ref:`swap_lines<class_TextEdit_method_swap_lines>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)** |
  342. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  343. | void | :ref:`tag_saved_version<class_TextEdit_method_tag_saved_version>` **(** **)** |
  344. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  345. | void | :ref:`undo<class_TextEdit_method_undo>` **(** **)** |
  346. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  347. Theme Properties
  348. ----------------
  349. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  350. | :ref:`Color<class_Color>` | :ref:`background_color<class_TextEdit_theme_color_background_color>` | ``Color(0, 0, 0, 0)`` |
  351. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  352. | :ref:`Color<class_Color>` | :ref:`caret_background_color<class_TextEdit_theme_color_caret_background_color>` | ``Color(0, 0, 0, 1)`` |
  353. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  354. | :ref:`Color<class_Color>` | :ref:`caret_color<class_TextEdit_theme_color_caret_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  355. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  356. | :ref:`Color<class_Color>` | :ref:`current_line_color<class_TextEdit_theme_color_current_line_color>` | ``Color(0.25, 0.25, 0.26, 0.8)`` |
  357. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  358. | :ref:`Color<class_Color>` | :ref:`font_color<class_TextEdit_theme_color_font_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  359. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  360. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_TextEdit_theme_color_font_outline_color>` | ``Color(1, 1, 1, 1)`` |
  361. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  362. | :ref:`Color<class_Color>` | :ref:`font_placeholder_color<class_TextEdit_theme_color_font_placeholder_color>` | ``Color(0.875, 0.875, 0.875, 0.6)`` |
  363. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  364. | :ref:`Color<class_Color>` | :ref:`font_readonly_color<class_TextEdit_theme_color_font_readonly_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  365. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  366. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_TextEdit_theme_color_font_selected_color>` | ``Color(1, 1, 1, 1)`` |
  367. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  368. | :ref:`Color<class_Color>` | :ref:`search_result_border_color<class_TextEdit_theme_color_search_result_border_color>` | ``Color(0.3, 0.3, 0.3, 0.4)`` |
  369. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  370. | :ref:`Color<class_Color>` | :ref:`search_result_color<class_TextEdit_theme_color_search_result_color>` | ``Color(0.3, 0.3, 0.3, 1)`` |
  371. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  372. | :ref:`Color<class_Color>` | :ref:`selection_color<class_TextEdit_theme_color_selection_color>` | ``Color(0.5, 0.5, 0.5, 1)`` |
  373. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  374. | :ref:`Color<class_Color>` | :ref:`word_highlighted_color<class_TextEdit_theme_color_word_highlighted_color>` | ``Color(0.5, 0.5, 0.5, 0.25)`` |
  375. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  376. | :ref:`int<class_int>` | :ref:`caret_width<class_TextEdit_theme_constant_caret_width>` | ``1`` |
  377. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  378. | :ref:`int<class_int>` | :ref:`line_spacing<class_TextEdit_theme_constant_line_spacing>` | ``4`` |
  379. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  380. | :ref:`int<class_int>` | :ref:`outline_size<class_TextEdit_theme_constant_outline_size>` | ``0`` |
  381. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  382. | :ref:`Font<class_Font>` | :ref:`font<class_TextEdit_theme_font_font>` | |
  383. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  384. | :ref:`int<class_int>` | :ref:`font_size<class_TextEdit_theme_font_size_font_size>` | |
  385. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  386. | :ref:`Texture2D<class_Texture2D>` | :ref:`space<class_TextEdit_theme_icon_space>` | |
  387. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  388. | :ref:`Texture2D<class_Texture2D>` | :ref:`tab<class_TextEdit_theme_icon_tab>` | |
  389. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  390. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_TextEdit_theme_style_focus>` | |
  391. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  392. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_TextEdit_theme_style_normal>` | |
  393. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  394. | :ref:`StyleBox<class_StyleBox>` | :ref:`read_only<class_TextEdit_theme_style_read_only>` | |
  395. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  396. Signals
  397. -------
  398. .. _class_TextEdit_signal_caret_changed:
  399. - **caret_changed** **(** **)**
  400. Emitted when the caret changes position.
  401. ----
  402. .. _class_TextEdit_signal_gutter_added:
  403. - **gutter_added** **(** **)**
  404. Emitted when a gutter is added.
  405. ----
  406. .. _class_TextEdit_signal_gutter_clicked:
  407. - **gutter_clicked** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)**
  408. Emitted when a gutter is clicked.
  409. ----
  410. .. _class_TextEdit_signal_gutter_removed:
  411. - **gutter_removed** **(** **)**
  412. Emitted when a gutter is removed.
  413. ----
  414. .. _class_TextEdit_signal_lines_edited_from:
  415. - **lines_edited_from** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)**
  416. Emitted immediately when the text changes.
  417. When text is added ``from_line`` will be less then ``to_line``. On a remove ``to_line`` will be less then ``from_line``.
  418. ----
  419. .. _class_TextEdit_signal_text_changed:
  420. - **text_changed** **(** **)**
  421. Emitted when the text changes.
  422. ----
  423. .. _class_TextEdit_signal_text_set:
  424. - **text_set** **(** **)**
  425. Emitted when :ref:`clear<class_TextEdit_method_clear>` is called or :ref:`text<class_TextEdit_property_text>` is set.
  426. Enumerations
  427. ------------
  428. .. _enum_TextEdit_MenuItems:
  429. .. _class_TextEdit_constant_MENU_CUT:
  430. .. _class_TextEdit_constant_MENU_COPY:
  431. .. _class_TextEdit_constant_MENU_PASTE:
  432. .. _class_TextEdit_constant_MENU_CLEAR:
  433. .. _class_TextEdit_constant_MENU_SELECT_ALL:
  434. .. _class_TextEdit_constant_MENU_UNDO:
  435. .. _class_TextEdit_constant_MENU_REDO:
  436. .. _class_TextEdit_constant_MENU_DIR_INHERITED:
  437. .. _class_TextEdit_constant_MENU_DIR_AUTO:
  438. .. _class_TextEdit_constant_MENU_DIR_LTR:
  439. .. _class_TextEdit_constant_MENU_DIR_RTL:
  440. .. _class_TextEdit_constant_MENU_DISPLAY_UCC:
  441. .. _class_TextEdit_constant_MENU_INSERT_LRM:
  442. .. _class_TextEdit_constant_MENU_INSERT_RLM:
  443. .. _class_TextEdit_constant_MENU_INSERT_LRE:
  444. .. _class_TextEdit_constant_MENU_INSERT_RLE:
  445. .. _class_TextEdit_constant_MENU_INSERT_LRO:
  446. .. _class_TextEdit_constant_MENU_INSERT_RLO:
  447. .. _class_TextEdit_constant_MENU_INSERT_PDF:
  448. .. _class_TextEdit_constant_MENU_INSERT_ALM:
  449. .. _class_TextEdit_constant_MENU_INSERT_LRI:
  450. .. _class_TextEdit_constant_MENU_INSERT_RLI:
  451. .. _class_TextEdit_constant_MENU_INSERT_FSI:
  452. .. _class_TextEdit_constant_MENU_INSERT_PDI:
  453. .. _class_TextEdit_constant_MENU_INSERT_ZWJ:
  454. .. _class_TextEdit_constant_MENU_INSERT_ZWNJ:
  455. .. _class_TextEdit_constant_MENU_INSERT_WJ:
  456. .. _class_TextEdit_constant_MENU_INSERT_SHY:
  457. .. _class_TextEdit_constant_MENU_MAX:
  458. enum **MenuItems**:
  459. - **MENU_CUT** = **0** --- Cuts (copies and clears) the selected text.
  460. - **MENU_COPY** = **1** --- Copies the selected text.
  461. - **MENU_PASTE** = **2** --- Pastes the clipboard text over the selected text (or at the cursor's position).
  462. - **MENU_CLEAR** = **3** --- Erases the whole ``TextEdit`` text.
  463. - **MENU_SELECT_ALL** = **4** --- Selects the whole ``TextEdit`` text.
  464. - **MENU_UNDO** = **5** --- Undoes the previous action.
  465. - **MENU_REDO** = **6** --- Redoes the previous action.
  466. - **MENU_DIR_INHERITED** = **7** --- Sets text direction to inherited.
  467. - **MENU_DIR_AUTO** = **8** --- Sets text direction to automatic.
  468. - **MENU_DIR_LTR** = **9** --- Sets text direction to left-to-right.
  469. - **MENU_DIR_RTL** = **10** --- Sets text direction to right-to-left.
  470. - **MENU_DISPLAY_UCC** = **11** --- Toggles control character display.
  471. - **MENU_INSERT_LRM** = **12** --- Inserts left-to-right mark (LRM) character.
  472. - **MENU_INSERT_RLM** = **13** --- Inserts right-to-left mark (RLM) character.
  473. - **MENU_INSERT_LRE** = **14** --- Inserts start of left-to-right embedding (LRE) character.
  474. - **MENU_INSERT_RLE** = **15** --- Inserts start of right-to-left embedding (RLE) character.
  475. - **MENU_INSERT_LRO** = **16** --- Inserts start of left-to-right override (LRO) character.
  476. - **MENU_INSERT_RLO** = **17** --- Inserts start of right-to-left override (RLO) character.
  477. - **MENU_INSERT_PDF** = **18** --- Inserts pop direction formatting (PDF) character.
  478. - **MENU_INSERT_ALM** = **19** --- Inserts Arabic letter mark (ALM) character.
  479. - **MENU_INSERT_LRI** = **20** --- Inserts left-to-right isolate (LRI) character.
  480. - **MENU_INSERT_RLI** = **21** --- Inserts right-to-left isolate (RLI) character.
  481. - **MENU_INSERT_FSI** = **22** --- Inserts first strong isolate (FSI) character.
  482. - **MENU_INSERT_PDI** = **23** --- Inserts pop direction isolate (PDI) character.
  483. - **MENU_INSERT_ZWJ** = **24** --- Inserts zero width joiner (ZWJ) character.
  484. - **MENU_INSERT_ZWNJ** = **25** --- Inserts zero width non-joiner (ZWNJ) character.
  485. - **MENU_INSERT_WJ** = **26** --- Inserts word joiner (WJ) character.
  486. - **MENU_INSERT_SHY** = **27** --- Inserts soft hyphen (SHY) character.
  487. - **MENU_MAX** = **28** --- Represents the size of the :ref:`MenuItems<enum_TextEdit_MenuItems>` enum.
  488. ----
  489. .. _enum_TextEdit_SearchFlags:
  490. .. _class_TextEdit_constant_SEARCH_MATCH_CASE:
  491. .. _class_TextEdit_constant_SEARCH_WHOLE_WORDS:
  492. .. _class_TextEdit_constant_SEARCH_BACKWARDS:
  493. enum **SearchFlags**:
  494. - **SEARCH_MATCH_CASE** = **1** --- Match case when searching.
  495. - **SEARCH_WHOLE_WORDS** = **2** --- Match whole words when searching.
  496. - **SEARCH_BACKWARDS** = **4** --- Search from end to beginning.
  497. ----
  498. .. _enum_TextEdit_CaretType:
  499. .. _class_TextEdit_constant_CARET_TYPE_LINE:
  500. .. _class_TextEdit_constant_CARET_TYPE_BLOCK:
  501. enum **CaretType**:
  502. - **CARET_TYPE_LINE** = **0** --- Vertical line caret.
  503. - **CARET_TYPE_BLOCK** = **1** --- Block caret.
  504. ----
  505. .. _enum_TextEdit_SelectionMode:
  506. .. _class_TextEdit_constant_SELECTION_MODE_NONE:
  507. .. _class_TextEdit_constant_SELECTION_MODE_SHIFT:
  508. .. _class_TextEdit_constant_SELECTION_MODE_POINTER:
  509. .. _class_TextEdit_constant_SELECTION_MODE_WORD:
  510. .. _class_TextEdit_constant_SELECTION_MODE_LINE:
  511. enum **SelectionMode**:
  512. - **SELECTION_MODE_NONE** = **0** --- Not selecting.
  513. - **SELECTION_MODE_SHIFT** = **1** --- Select as if ``shift`` is pressed.
  514. - **SELECTION_MODE_POINTER** = **2** --- Select single characters as if the user single clicked.
  515. - **SELECTION_MODE_WORD** = **3** --- Select whole words as if the user double clicked.
  516. - **SELECTION_MODE_LINE** = **4** --- Select whole lines as if the user tripped clicked.
  517. ----
  518. .. _enum_TextEdit_LineWrappingMode:
  519. .. _class_TextEdit_constant_LINE_WRAPPING_NONE:
  520. .. _class_TextEdit_constant_LINE_WRAPPING_BOUNDARY:
  521. enum **LineWrappingMode**:
  522. - **LINE_WRAPPING_NONE** = **0** --- Line wrapping is disabled.
  523. - **LINE_WRAPPING_BOUNDARY** = **1** --- Line wrapping occurs at the control boundary, beyond what would normally be visible.
  524. ----
  525. .. _enum_TextEdit_GutterType:
  526. .. _class_TextEdit_constant_GUTTER_TYPE_STRING:
  527. .. _class_TextEdit_constant_GUTTER_TYPE_ICON:
  528. .. _class_TextEdit_constant_GUTTER_TYPE_CUSTOM:
  529. enum **GutterType**:
  530. - **GUTTER_TYPE_STRING** = **0** --- Draw a string.
  531. - **GUTTER_TYPE_ICON** = **1** --- Draw an icon.
  532. - **GUTTER_TYPE_CUSTOM** = **2** --- Custom draw.
  533. Property Descriptions
  534. ---------------------
  535. .. _class_TextEdit_property_caret_blink:
  536. - :ref:`bool<class_bool>` **caret_blink**
  537. +-----------+--------------------------------+
  538. | *Default* | ``false`` |
  539. +-----------+--------------------------------+
  540. | *Setter* | set_caret_blink_enabled(value) |
  541. +-----------+--------------------------------+
  542. | *Getter* | is_caret_blink_enabled() |
  543. +-----------+--------------------------------+
  544. Sets if the caret should blink.
  545. ----
  546. .. _class_TextEdit_property_caret_blink_speed:
  547. - :ref:`float<class_float>` **caret_blink_speed**
  548. +-----------+------------------------------+
  549. | *Default* | ``0.65`` |
  550. +-----------+------------------------------+
  551. | *Setter* | set_caret_blink_speed(value) |
  552. +-----------+------------------------------+
  553. | *Getter* | get_caret_blink_speed() |
  554. +-----------+------------------------------+
  555. Duration (in seconds) of a caret's blinking cycle.
  556. ----
  557. .. _class_TextEdit_property_caret_mid_grapheme:
  558. - :ref:`bool<class_bool>` **caret_mid_grapheme**
  559. +-----------+---------------------------------------+
  560. | *Default* | ``true`` |
  561. +-----------+---------------------------------------+
  562. | *Setter* | set_caret_mid_grapheme_enabled(value) |
  563. +-----------+---------------------------------------+
  564. | *Getter* | is_caret_mid_grapheme_enabled() |
  565. +-----------+---------------------------------------+
  566. Allow moving caret, selecting and removing the individual composite character components.
  567. \ **Note:** :kbd:`Backspace` is always removing individual composite character components.
  568. ----
  569. .. _class_TextEdit_property_caret_move_on_right_click:
  570. - :ref:`bool<class_bool>` **caret_move_on_right_click**
  571. +-----------+----------------------------------------------+
  572. | *Default* | ``true`` |
  573. +-----------+----------------------------------------------+
  574. | *Setter* | set_move_caret_on_right_click_enabled(value) |
  575. +-----------+----------------------------------------------+
  576. | *Getter* | is_move_caret_on_right_click_enabled() |
  577. +-----------+----------------------------------------------+
  578. If ``true``, a right-click moves the caret at the mouse position before displaying the context menu.
  579. If ``false``, the context menu disregards mouse location.
  580. ----
  581. .. _class_TextEdit_property_caret_type:
  582. - :ref:`CaretType<enum_TextEdit_CaretType>` **caret_type**
  583. +-----------+-----------------------+
  584. | *Default* | ``0`` |
  585. +-----------+-----------------------+
  586. | *Setter* | set_caret_type(value) |
  587. +-----------+-----------------------+
  588. | *Getter* | get_caret_type() |
  589. +-----------+-----------------------+
  590. Set the type of caret to draw.
  591. ----
  592. .. _class_TextEdit_property_context_menu_enabled:
  593. - :ref:`bool<class_bool>` **context_menu_enabled**
  594. +-----------+---------------------------------+
  595. | *Default* | ``true`` |
  596. +-----------+---------------------------------+
  597. | *Setter* | set_context_menu_enabled(value) |
  598. +-----------+---------------------------------+
  599. | *Getter* | is_context_menu_enabled() |
  600. +-----------+---------------------------------+
  601. If ``true``, a right-click displays the context menu.
  602. ----
  603. .. _class_TextEdit_property_deselect_on_focus_loss_enabled:
  604. - :ref:`bool<class_bool>` **deselect_on_focus_loss_enabled**
  605. +-----------+-------------------------------------------+
  606. | *Default* | ``true`` |
  607. +-----------+-------------------------------------------+
  608. | *Setter* | set_deselect_on_focus_loss_enabled(value) |
  609. +-----------+-------------------------------------------+
  610. | *Getter* | is_deselect_on_focus_loss_enabled() |
  611. +-----------+-------------------------------------------+
  612. If ``true``, the selected text will be deselected when focus is lost.
  613. ----
  614. .. _class_TextEdit_property_draw_control_chars:
  615. - :ref:`bool<class_bool>` **draw_control_chars**
  616. +-----------+-------------------------------+
  617. | *Default* | ``false`` |
  618. +-----------+-------------------------------+
  619. | *Setter* | set_draw_control_chars(value) |
  620. +-----------+-------------------------------+
  621. | *Getter* | get_draw_control_chars() |
  622. +-----------+-------------------------------+
  623. If ``true``, control characters are displayed.
  624. ----
  625. .. _class_TextEdit_property_draw_spaces:
  626. - :ref:`bool<class_bool>` **draw_spaces**
  627. +-----------+------------------------+
  628. | *Default* | ``false`` |
  629. +-----------+------------------------+
  630. | *Setter* | set_draw_spaces(value) |
  631. +-----------+------------------------+
  632. | *Getter* | is_drawing_spaces() |
  633. +-----------+------------------------+
  634. If ``true``, the "space" character will have a visible representation.
  635. ----
  636. .. _class_TextEdit_property_draw_tabs:
  637. - :ref:`bool<class_bool>` **draw_tabs**
  638. +-----------+----------------------+
  639. | *Default* | ``false`` |
  640. +-----------+----------------------+
  641. | *Setter* | set_draw_tabs(value) |
  642. +-----------+----------------------+
  643. | *Getter* | is_drawing_tabs() |
  644. +-----------+----------------------+
  645. If ``true``, the "tab" character will have a visible representation.
  646. ----
  647. .. _class_TextEdit_property_editable:
  648. - :ref:`bool<class_bool>` **editable**
  649. +-----------+---------------------+
  650. | *Default* | ``true`` |
  651. +-----------+---------------------+
  652. | *Setter* | set_editable(value) |
  653. +-----------+---------------------+
  654. | *Getter* | is_editable() |
  655. +-----------+---------------------+
  656. If ``false``, existing text cannot be modified and new text cannot be added.
  657. ----
  658. .. _class_TextEdit_property_highlight_all_occurrences:
  659. - :ref:`bool<class_bool>` **highlight_all_occurrences**
  660. +-----------+----------------------------------------+
  661. | *Default* | ``false`` |
  662. +-----------+----------------------------------------+
  663. | *Setter* | set_highlight_all_occurrences(value) |
  664. +-----------+----------------------------------------+
  665. | *Getter* | is_highlight_all_occurrences_enabled() |
  666. +-----------+----------------------------------------+
  667. If ``true``, all occurrences of the selected text will be highlighted.
  668. ----
  669. .. _class_TextEdit_property_highlight_current_line:
  670. - :ref:`bool<class_bool>` **highlight_current_line**
  671. +-----------+-------------------------------------+
  672. | *Default* | ``false`` |
  673. +-----------+-------------------------------------+
  674. | *Setter* | set_highlight_current_line(value) |
  675. +-----------+-------------------------------------+
  676. | *Getter* | is_highlight_current_line_enabled() |
  677. +-----------+-------------------------------------+
  678. If ``true``, the line containing the cursor is highlighted.
  679. ----
  680. .. _class_TextEdit_property_language:
  681. - :ref:`String<class_String>` **language**
  682. +-----------+---------------------+
  683. | *Default* | ``""`` |
  684. +-----------+---------------------+
  685. | *Setter* | set_language(value) |
  686. +-----------+---------------------+
  687. | *Getter* | get_language() |
  688. +-----------+---------------------+
  689. Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  690. ----
  691. .. _class_TextEdit_property_middle_mouse_paste_enabled:
  692. - :ref:`bool<class_bool>` **middle_mouse_paste_enabled**
  693. +-----------+---------------------------------------+
  694. | *Default* | ``true`` |
  695. +-----------+---------------------------------------+
  696. | *Setter* | set_middle_mouse_paste_enabled(value) |
  697. +-----------+---------------------------------------+
  698. | *Getter* | is_middle_mouse_paste_enabled() |
  699. +-----------+---------------------------------------+
  700. If ``false``, using middle mouse button to paste clipboard will be disabled.
  701. \ **Note:** This method is only implemented on Linux.
  702. ----
  703. .. _class_TextEdit_property_minimap_draw:
  704. - :ref:`bool<class_bool>` **minimap_draw**
  705. +-----------+-------------------------+
  706. | *Default* | ``false`` |
  707. +-----------+-------------------------+
  708. | *Setter* | set_draw_minimap(value) |
  709. +-----------+-------------------------+
  710. | *Getter* | is_drawing_minimap() |
  711. +-----------+-------------------------+
  712. If ``true``, a minimap is shown, providing an outline of your source code.
  713. ----
  714. .. _class_TextEdit_property_minimap_width:
  715. - :ref:`int<class_int>` **minimap_width**
  716. +-----------+--------------------------+
  717. | *Default* | ``80`` |
  718. +-----------+--------------------------+
  719. | *Setter* | set_minimap_width(value) |
  720. +-----------+--------------------------+
  721. | *Getter* | get_minimap_width() |
  722. +-----------+--------------------------+
  723. The width, in pixels, of the minimap.
  724. ----
  725. .. _class_TextEdit_property_override_selected_font_color:
  726. - :ref:`bool<class_bool>` **override_selected_font_color**
  727. +-----------+-----------------------------------------+
  728. | *Default* | ``false`` |
  729. +-----------+-----------------------------------------+
  730. | *Setter* | set_override_selected_font_color(value) |
  731. +-----------+-----------------------------------------+
  732. | *Getter* | is_overriding_selected_font_color() |
  733. +-----------+-----------------------------------------+
  734. If ``true``, custom ``font_selected_color`` will be used for selected text.
  735. ----
  736. .. _class_TextEdit_property_placeholder_text:
  737. - :ref:`String<class_String>` **placeholder_text**
  738. +-----------+------------------------+
  739. | *Default* | ``""`` |
  740. +-----------+------------------------+
  741. | *Setter* | set_placeholder(value) |
  742. +-----------+------------------------+
  743. | *Getter* | get_placeholder() |
  744. +-----------+------------------------+
  745. Text shown when the ``TextEdit`` is empty. It is **not** the ``TextEdit``'s default value (see :ref:`text<class_TextEdit_property_text>`).
  746. ----
  747. .. _class_TextEdit_property_scroll_horizontal:
  748. - :ref:`int<class_int>` **scroll_horizontal**
  749. +-----------+---------------------+
  750. | *Default* | ``0`` |
  751. +-----------+---------------------+
  752. | *Setter* | set_h_scroll(value) |
  753. +-----------+---------------------+
  754. | *Getter* | get_h_scroll() |
  755. +-----------+---------------------+
  756. If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels.
  757. ----
  758. .. _class_TextEdit_property_scroll_past_end_of_file:
  759. - :ref:`bool<class_bool>` **scroll_past_end_of_file**
  760. +-----------+--------------------------------------------+
  761. | *Default* | ``false`` |
  762. +-----------+--------------------------------------------+
  763. | *Setter* | set_scroll_past_end_of_file_enabled(value) |
  764. +-----------+--------------------------------------------+
  765. | *Getter* | is_scroll_past_end_of_file_enabled() |
  766. +-----------+--------------------------------------------+
  767. Allow scrolling past the last line into "virtual" space.
  768. ----
  769. .. _class_TextEdit_property_scroll_smooth:
  770. - :ref:`bool<class_bool>` **scroll_smooth**
  771. +-----------+---------------------------------+
  772. | *Default* | ``false`` |
  773. +-----------+---------------------------------+
  774. | *Setter* | set_smooth_scroll_enable(value) |
  775. +-----------+---------------------------------+
  776. | *Getter* | is_smooth_scroll_enabled() |
  777. +-----------+---------------------------------+
  778. Scroll smoothly over the text rather then jumping to the next location.
  779. ----
  780. .. _class_TextEdit_property_scroll_v_scroll_speed:
  781. - :ref:`float<class_float>` **scroll_v_scroll_speed**
  782. +-----------+---------------------------+
  783. | *Default* | ``80.0`` |
  784. +-----------+---------------------------+
  785. | *Setter* | set_v_scroll_speed(value) |
  786. +-----------+---------------------------+
  787. | *Getter* | get_v_scroll_speed() |
  788. +-----------+---------------------------+
  789. Sets the scroll speed with the minimap or when :ref:`scroll_smooth<class_TextEdit_property_scroll_smooth>` is enabled.
  790. ----
  791. .. _class_TextEdit_property_scroll_vertical:
  792. - :ref:`float<class_float>` **scroll_vertical**
  793. +-----------+---------------------+
  794. | *Default* | ``0.0`` |
  795. +-----------+---------------------+
  796. | *Setter* | set_v_scroll(value) |
  797. +-----------+---------------------+
  798. | *Getter* | get_v_scroll() |
  799. +-----------+---------------------+
  800. If there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line.
  801. ----
  802. .. _class_TextEdit_property_selecting_enabled:
  803. - :ref:`bool<class_bool>` **selecting_enabled**
  804. +-----------+------------------------------+
  805. | *Default* | ``true`` |
  806. +-----------+------------------------------+
  807. | *Setter* | set_selecting_enabled(value) |
  808. +-----------+------------------------------+
  809. | *Getter* | is_selecting_enabled() |
  810. +-----------+------------------------------+
  811. If ``true``, text can be selected.
  812. If ``false``, text can not be selected by the user or by the :ref:`select<class_TextEdit_method_select>` or :ref:`select_all<class_TextEdit_method_select_all>` methods.
  813. ----
  814. .. _class_TextEdit_property_shortcut_keys_enabled:
  815. - :ref:`bool<class_bool>` **shortcut_keys_enabled**
  816. +-----------+----------------------------------+
  817. | *Default* | ``true`` |
  818. +-----------+----------------------------------+
  819. | *Setter* | set_shortcut_keys_enabled(value) |
  820. +-----------+----------------------------------+
  821. | *Getter* | is_shortcut_keys_enabled() |
  822. +-----------+----------------------------------+
  823. If ``true``, shortcut keys for context menu items are enabled, even if the context menu is disabled.
  824. ----
  825. .. _class_TextEdit_property_structured_text_bidi_override:
  826. - :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` **structured_text_bidi_override**
  827. +-----------+------------------------------------------+
  828. | *Default* | ``0`` |
  829. +-----------+------------------------------------------+
  830. | *Setter* | set_structured_text_bidi_override(value) |
  831. +-----------+------------------------------------------+
  832. | *Getter* | get_structured_text_bidi_override() |
  833. +-----------+------------------------------------------+
  834. Set BiDi algorithm override for the structured text.
  835. ----
  836. .. _class_TextEdit_property_structured_text_bidi_override_options:
  837. - :ref:`Array<class_Array>` **structured_text_bidi_override_options**
  838. +-----------+--------------------------------------------------+
  839. | *Default* | ``[]`` |
  840. +-----------+--------------------------------------------------+
  841. | *Setter* | set_structured_text_bidi_override_options(value) |
  842. +-----------+--------------------------------------------------+
  843. | *Getter* | get_structured_text_bidi_override_options() |
  844. +-----------+--------------------------------------------------+
  845. Set additional options for BiDi override.
  846. ----
  847. .. _class_TextEdit_property_syntax_highlighter:
  848. - :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` **syntax_highlighter**
  849. +----------+-------------------------------+
  850. | *Setter* | set_syntax_highlighter(value) |
  851. +----------+-------------------------------+
  852. | *Getter* | get_syntax_highlighter() |
  853. +----------+-------------------------------+
  854. Sets the :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` to use.
  855. ----
  856. .. _class_TextEdit_property_text:
  857. - :ref:`String<class_String>` **text**
  858. +-----------+-----------------+
  859. | *Default* | ``""`` |
  860. +-----------+-----------------+
  861. | *Setter* | set_text(value) |
  862. +-----------+-----------------+
  863. | *Getter* | get_text() |
  864. +-----------+-----------------+
  865. String value of the ``TextEdit``.
  866. ----
  867. .. _class_TextEdit_property_text_direction:
  868. - :ref:`TextDirection<enum_Control_TextDirection>` **text_direction**
  869. +-----------+---------------------------+
  870. | *Default* | ``0`` |
  871. +-----------+---------------------------+
  872. | *Setter* | set_text_direction(value) |
  873. +-----------+---------------------------+
  874. | *Getter* | get_text_direction() |
  875. +-----------+---------------------------+
  876. Base text writing direction.
  877. ----
  878. .. _class_TextEdit_property_virtual_keyboard_enabled:
  879. - :ref:`bool<class_bool>` **virtual_keyboard_enabled**
  880. +-----------+-------------------------------------+
  881. | *Default* | ``true`` |
  882. +-----------+-------------------------------------+
  883. | *Setter* | set_virtual_keyboard_enabled(value) |
  884. +-----------+-------------------------------------+
  885. | *Getter* | is_virtual_keyboard_enabled() |
  886. +-----------+-------------------------------------+
  887. If ``true``, the native virtual keyboard is shown when focused on platforms that support it.
  888. ----
  889. .. _class_TextEdit_property_wrap_mode:
  890. - :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` **wrap_mode**
  891. +-----------+-------------------------------+
  892. | *Default* | ``0`` |
  893. +-----------+-------------------------------+
  894. | *Setter* | set_line_wrapping_mode(value) |
  895. +-----------+-------------------------------+
  896. | *Getter* | get_line_wrapping_mode() |
  897. +-----------+-------------------------------+
  898. Sets the line wrapping mode to use.
  899. Method Descriptions
  900. -------------------
  901. .. _class_TextEdit_method__backspace:
  902. - void **_backspace** **(** **)** |virtual|
  903. Override this method to define what happens when the user presses the backspace key.
  904. ----
  905. .. _class_TextEdit_method__copy:
  906. - void **_copy** **(** **)** |virtual|
  907. Override this method to define what happens when the user performs a copy operation.
  908. ----
  909. .. _class_TextEdit_method__cut:
  910. - void **_cut** **(** **)** |virtual|
  911. Override this method to define what happens when the user performs a cut operation.
  912. ----
  913. .. _class_TextEdit_method__handle_unicode_input:
  914. - void **_handle_unicode_input** **(** :ref:`int<class_int>` unicode_char **)** |virtual|
  915. Override this method to define what happens when the types in the provided key ``unicode``.
  916. ----
  917. .. _class_TextEdit_method__paste:
  918. - void **_paste** **(** **)** |virtual|
  919. Override this method to define what happens when the user performs a paste operation.
  920. ----
  921. .. _class_TextEdit_method__paste_primary_clipboard:
  922. - void **_paste_primary_clipboard** **(** **)** |virtual|
  923. Override this method to define what happens when the user performs a paste operation with middle mouse button.
  924. \ **Note:** This method is only implemented on Linux.
  925. ----
  926. .. _class_TextEdit_method_add_gutter:
  927. - void **add_gutter** **(** :ref:`int<class_int>` at=-1 **)**
  928. 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.
  929. ----
  930. .. _class_TextEdit_method_adjust_viewport_to_caret:
  931. - void **adjust_viewport_to_caret** **(** **)**
  932. Adjust the viewport so the caret is visible.
  933. ----
  934. .. _class_TextEdit_method_backspace:
  935. - void **backspace** **(** **)**
  936. Called when the user presses the backspace key. Can be overridden with :ref:`_backspace<class_TextEdit_method__backspace>`.
  937. ----
  938. .. _class_TextEdit_method_begin_complex_operation:
  939. - void **begin_complex_operation** **(** **)**
  940. Starts a multipart edit. All edits will be treated as one action until :ref:`end_complex_operation<class_TextEdit_method_end_complex_operation>` is called.
  941. ----
  942. .. _class_TextEdit_method_center_viewport_to_caret:
  943. - void **center_viewport_to_caret** **(** **)**
  944. Centers the viewport on the line the editing caret is at. This also resets the :ref:`scroll_horizontal<class_TextEdit_property_scroll_horizontal>` value to ``0``.
  945. ----
  946. .. _class_TextEdit_method_clear:
  947. - void **clear** **(** **)**
  948. Performs a full reset of ``TextEdit``, including undo history.
  949. ----
  950. .. _class_TextEdit_method_clear_opentype_features:
  951. - void **clear_opentype_features** **(** **)**
  952. Removes all OpenType features.
  953. ----
  954. .. _class_TextEdit_method_clear_undo_history:
  955. - void **clear_undo_history** **(** **)**
  956. Clears the undo history.
  957. ----
  958. .. _class_TextEdit_method_copy:
  959. - void **copy** **(** **)**
  960. Copies the current text selection. Can be overridden with :ref:`_copy<class_TextEdit_method__copy>`.
  961. ----
  962. .. _class_TextEdit_method_cut:
  963. - void **cut** **(** **)**
  964. Cut's the current selection. Can be overridden with :ref:`_cut<class_TextEdit_method__cut>`.
  965. ----
  966. .. _class_TextEdit_method_delete_selection:
  967. - void **delete_selection** **(** **)**
  968. Deletes the selected text.
  969. ----
  970. .. _class_TextEdit_method_deselect:
  971. - void **deselect** **(** **)**
  972. Deselects the current selection.
  973. ----
  974. .. _class_TextEdit_method_end_complex_operation:
  975. - void **end_complex_operation** **(** **)**
  976. Ends a multipart edit, started with :ref:`begin_complex_operation<class_TextEdit_method_begin_complex_operation>`. If called outside a complex operation, the current operation is pushed onto the undo/redo stack.
  977. ----
  978. .. _class_TextEdit_method_get_caret_column:
  979. - :ref:`int<class_int>` **get_caret_column** **(** **)** |const|
  980. Returns the column the editing caret is at.
  981. ----
  982. .. _class_TextEdit_method_get_caret_draw_pos:
  983. - :ref:`Vector2<class_Vector2>` **get_caret_draw_pos** **(** **)** |const|
  984. Returns the caret pixel draw position.
  985. ----
  986. .. _class_TextEdit_method_get_caret_line:
  987. - :ref:`int<class_int>` **get_caret_line** **(** **)** |const|
  988. Returns the line the editing caret is on.
  989. ----
  990. .. _class_TextEdit_method_get_caret_wrap_index:
  991. - :ref:`int<class_int>` **get_caret_wrap_index** **(** **)** |const|
  992. Returns the wrap index the editing caret is on.
  993. ----
  994. .. _class_TextEdit_method_get_first_non_whitespace_column:
  995. - :ref:`int<class_int>` **get_first_non_whitespace_column** **(** :ref:`int<class_int>` line **)** |const|
  996. Returns the first column containing a non-whitespace character.
  997. ----
  998. .. _class_TextEdit_method_get_first_visible_line:
  999. - :ref:`int<class_int>` **get_first_visible_line** **(** **)** |const|
  1000. Returns the first visible line.
  1001. ----
  1002. .. _class_TextEdit_method_get_gutter_count:
  1003. - :ref:`int<class_int>` **get_gutter_count** **(** **)** |const|
  1004. Returns the total amount of gutters registered.
  1005. ----
  1006. .. _class_TextEdit_method_get_gutter_name:
  1007. - :ref:`String<class_String>` **get_gutter_name** **(** :ref:`int<class_int>` gutter **)** |const|
  1008. Returns the name of the gutter at the given index.
  1009. ----
  1010. .. _class_TextEdit_method_get_gutter_type:
  1011. - :ref:`GutterType<enum_TextEdit_GutterType>` **get_gutter_type** **(** :ref:`int<class_int>` gutter **)** |const|
  1012. Returns the type of the gutter at the given index.
  1013. ----
  1014. .. _class_TextEdit_method_get_gutter_width:
  1015. - :ref:`int<class_int>` **get_gutter_width** **(** :ref:`int<class_int>` gutter **)** |const|
  1016. Returns the width of the gutter at the given index.
  1017. ----
  1018. .. _class_TextEdit_method_get_indent_level:
  1019. - :ref:`int<class_int>` **get_indent_level** **(** :ref:`int<class_int>` line **)** |const|
  1020. Returns the amount of spaces and ``tab * tab_size`` before the first char.
  1021. ----
  1022. .. _class_TextEdit_method_get_last_full_visible_line:
  1023. - :ref:`int<class_int>` **get_last_full_visible_line** **(** **)** |const|
  1024. Returns the last visible line. Use :ref:`get_last_full_visible_line_wrap_index<class_TextEdit_method_get_last_full_visible_line_wrap_index>` for the wrap index.
  1025. ----
  1026. .. _class_TextEdit_method_get_last_full_visible_line_wrap_index:
  1027. - :ref:`int<class_int>` **get_last_full_visible_line_wrap_index** **(** **)** |const|
  1028. Returns the last visible wrap index of the last visible line.
  1029. ----
  1030. .. _class_TextEdit_method_get_last_unhidden_line:
  1031. - :ref:`int<class_int>` **get_last_unhidden_line** **(** **)** |const|
  1032. Returns the last unhidden line in the entire ``TextEdit``.
  1033. ----
  1034. .. _class_TextEdit_method_get_line:
  1035. - :ref:`String<class_String>` **get_line** **(** :ref:`int<class_int>` line **)** |const|
  1036. Returns the text of a specific line.
  1037. ----
  1038. .. _class_TextEdit_method_get_line_background_color:
  1039. - :ref:`Color<class_Color>` **get_line_background_color** **(** :ref:`int<class_int>` line **)** |const|
  1040. Returns the current background color of the line. ``Color(0, 0, 0, 0)`` is returned if no color is set.
  1041. ----
  1042. .. _class_TextEdit_method_get_line_column_at_pos:
  1043. - :ref:`Vector2i<class_Vector2i>` **get_line_column_at_pos** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`bool<class_bool>` allow_out_of_bounds=true **)** |const|
  1044. Returns the line and column at the given position. In the returned vector, ``x`` is the column, ``y`` is the line. If ``allow_out_of_bounds`` is ``false`` and the position is not over the text, both vector values will be set to ``-1``.
  1045. ----
  1046. .. _class_TextEdit_method_get_line_count:
  1047. - :ref:`int<class_int>` **get_line_count** **(** **)** |const|
  1048. Returns the amount of total lines in the text.
  1049. ----
  1050. .. _class_TextEdit_method_get_line_gutter_icon:
  1051. - :ref:`Texture2D<class_Texture2D>` **get_line_gutter_icon** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
  1052. Returns the icon currently in ``gutter`` at ``line``.
  1053. ----
  1054. .. _class_TextEdit_method_get_line_gutter_item_color:
  1055. - :ref:`Color<class_Color>` **get_line_gutter_item_color** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
  1056. Returns the color currently in ``gutter`` at ``line``.
  1057. ----
  1058. .. _class_TextEdit_method_get_line_gutter_metadata:
  1059. - :ref:`Variant<class_Variant>` **get_line_gutter_metadata** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
  1060. Returns the metadata currently in ``gutter`` at ``line``.
  1061. ----
  1062. .. _class_TextEdit_method_get_line_gutter_text:
  1063. - :ref:`String<class_String>` **get_line_gutter_text** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
  1064. Returns the text currently in ``gutter`` at ``line``.
  1065. ----
  1066. .. _class_TextEdit_method_get_line_height:
  1067. - :ref:`int<class_int>` **get_line_height** **(** **)** |const|
  1068. Returns the height of a largest line.
  1069. ----
  1070. .. _class_TextEdit_method_get_line_width:
  1071. - :ref:`int<class_int>` **get_line_width** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=-1 **)** |const|
  1072. Returns the width in pixels of the ``wrap_index`` on ``line``.
  1073. ----
  1074. .. _class_TextEdit_method_get_line_wrap_count:
  1075. - :ref:`int<class_int>` **get_line_wrap_count** **(** :ref:`int<class_int>` line **)** |const|
  1076. Returns the number of times the given line is wrapped.
  1077. ----
  1078. .. _class_TextEdit_method_get_line_wrap_index_at_column:
  1079. - :ref:`int<class_int>` **get_line_wrap_index_at_column** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
  1080. Returns the wrap index of the given line column.
  1081. ----
  1082. .. _class_TextEdit_method_get_line_wrapped_text:
  1083. - :ref:`PackedStringArray<class_PackedStringArray>` **get_line_wrapped_text** **(** :ref:`int<class_int>` line **)** |const|
  1084. Returns an array of :ref:`String<class_String>`\ s representing each wrapped index.
  1085. ----
  1086. .. _class_TextEdit_method_get_local_mouse_pos:
  1087. - :ref:`Vector2<class_Vector2>` **get_local_mouse_pos** **(** **)** |const|
  1088. Returns the local mouse position adjusted for the text direction.
  1089. ----
  1090. .. _class_TextEdit_method_get_menu:
  1091. - :ref:`PopupMenu<class_PopupMenu>` **get_menu** **(** **)** |const|
  1092. Returns the :ref:`PopupMenu<class_PopupMenu>` of this ``TextEdit``. By default, this menu is displayed when right-clicking on the ``TextEdit``.
  1093. \ **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 :ref:`Window.visible<class_Window_property_visible>` property.
  1094. ----
  1095. .. _class_TextEdit_method_get_minimap_line_at_pos:
  1096. - :ref:`int<class_int>` **get_minimap_line_at_pos** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  1097. Returns the equivalent minimap line at ``position``
  1098. ----
  1099. .. _class_TextEdit_method_get_minimap_visible_lines:
  1100. - :ref:`int<class_int>` **get_minimap_visible_lines** **(** **)** |const|
  1101. Returns the total amount of lines that can be draw on the minimap.
  1102. ----
  1103. .. _class_TextEdit_method_get_next_visible_line_index_offset_from:
  1104. - :ref:`Vector2i<class_Vector2i>` **get_next_visible_line_index_offset_from** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index, :ref:`int<class_int>` visible_amount **)** |const|
  1105. Similar to :ref:`get_next_visible_line_offset_from<class_TextEdit_method_get_next_visible_line_offset_from>`, but takes into account the line wrap indexes. In the returned vector, ``x`` is the line, ``y`` is the wrap index.
  1106. ----
  1107. .. _class_TextEdit_method_get_next_visible_line_offset_from:
  1108. - :ref:`int<class_int>` **get_next_visible_line_offset_from** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` visible_amount **)** |const|
  1109. 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.
  1110. ----
  1111. .. _class_TextEdit_method_get_opentype_feature:
  1112. - :ref:`int<class_int>` **get_opentype_feature** **(** :ref:`String<class_String>` tag **)** |const|
  1113. Returns OpenType feature ``tag``.
  1114. ----
  1115. .. _class_TextEdit_method_get_pos_at_line_column:
  1116. - :ref:`Vector2i<class_Vector2i>` **get_pos_at_line_column** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
  1117. 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.
  1118. \ **Note:** The Y position corresponds to the bottom side of the line. Use :ref:`get_rect_at_line_column<class_TextEdit_method_get_rect_at_line_column>` to get the top side position.
  1119. ----
  1120. .. _class_TextEdit_method_get_rect_at_line_column:
  1121. - :ref:`Rect2i<class_Rect2i>` **get_rect_at_line_column** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
  1122. 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.
  1123. \ **Note:** The Y position of the returned rect corresponds to the top side of the line, unlike :ref:`get_pos_at_line_column<class_TextEdit_method_get_pos_at_line_column>` which returns the bottom side.
  1124. ----
  1125. .. _class_TextEdit_method_get_saved_version:
  1126. - :ref:`int<class_int>` **get_saved_version** **(** **)** |const|
  1127. Returns the last tagged saved version from :ref:`tag_saved_version<class_TextEdit_method_tag_saved_version>`
  1128. ----
  1129. .. _class_TextEdit_method_get_scroll_pos_for_line:
  1130. - :ref:`float<class_float>` **get_scroll_pos_for_line** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |const|
  1131. Returns the scroll position for ``wrap_index`` of ``line``.
  1132. ----
  1133. .. _class_TextEdit_method_get_selected_text:
  1134. - :ref:`String<class_String>` **get_selected_text** **(** **)** |const|
  1135. Returns the text inside the selection.
  1136. ----
  1137. .. _class_TextEdit_method_get_selection_column:
  1138. - :ref:`int<class_int>` **get_selection_column** **(** **)** |const|
  1139. Returns the original start column of the selection.
  1140. ----
  1141. .. _class_TextEdit_method_get_selection_from_column:
  1142. - :ref:`int<class_int>` **get_selection_from_column** **(** **)** |const|
  1143. Returns the selection begin column.
  1144. ----
  1145. .. _class_TextEdit_method_get_selection_from_line:
  1146. - :ref:`int<class_int>` **get_selection_from_line** **(** **)** |const|
  1147. Returns the selection begin line.
  1148. ----
  1149. .. _class_TextEdit_method_get_selection_line:
  1150. - :ref:`int<class_int>` **get_selection_line** **(** **)** |const|
  1151. Returns the original start line of the selection.
  1152. ----
  1153. .. _class_TextEdit_method_get_selection_mode:
  1154. - :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **get_selection_mode** **(** **)** |const|
  1155. Returns the current selection mode.
  1156. ----
  1157. .. _class_TextEdit_method_get_selection_to_column:
  1158. - :ref:`int<class_int>` **get_selection_to_column** **(** **)** |const|
  1159. Returns the selection end column.
  1160. ----
  1161. .. _class_TextEdit_method_get_selection_to_line:
  1162. - :ref:`int<class_int>` **get_selection_to_line** **(** **)** |const|
  1163. Returns the selection end line.
  1164. ----
  1165. .. _class_TextEdit_method_get_tab_size:
  1166. - :ref:`int<class_int>` **get_tab_size** **(** **)** |const|
  1167. Returns the ``TextEdit``'s' tab size.
  1168. ----
  1169. .. _class_TextEdit_method_get_total_gutter_width:
  1170. - :ref:`int<class_int>` **get_total_gutter_width** **(** **)** |const|
  1171. Returns the total width of all gutters and internal padding.
  1172. ----
  1173. .. _class_TextEdit_method_get_total_visible_line_count:
  1174. - :ref:`int<class_int>` **get_total_visible_line_count** **(** **)** |const|
  1175. Returns the total amount of lines that could be draw.
  1176. ----
  1177. .. _class_TextEdit_method_get_version:
  1178. - :ref:`int<class_int>` **get_version** **(** **)** |const|
  1179. Returns the current version of the ``TextEdit``. The version is a count of recorded operations by the undo/redo history.
  1180. ----
  1181. .. _class_TextEdit_method_get_visible_line_count:
  1182. - :ref:`int<class_int>` **get_visible_line_count** **(** **)** |const|
  1183. Returns the number of visible lines, including wrapped text.
  1184. ----
  1185. .. _class_TextEdit_method_get_visible_line_count_in_range:
  1186. - :ref:`int<class_int>` **get_visible_line_count_in_range** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)** |const|
  1187. Returns the total number of visible + wrapped lines between the two lines.
  1188. ----
  1189. .. _class_TextEdit_method_get_word_at_pos:
  1190. - :ref:`String<class_String>` **get_word_at_pos** **(** :ref:`Vector2<class_Vector2>` position **)** |const|
  1191. Returns the word at ``position``.
  1192. ----
  1193. .. _class_TextEdit_method_get_word_under_caret:
  1194. - :ref:`String<class_String>` **get_word_under_caret** **(** **)** |const|
  1195. Returns a :ref:`String<class_String>` text with the word under the caret's location.
  1196. ----
  1197. .. _class_TextEdit_method_has_ime_text:
  1198. - :ref:`bool<class_bool>` **has_ime_text** **(** **)** |const|
  1199. Returns if the user has IME text.
  1200. ----
  1201. .. _class_TextEdit_method_has_redo:
  1202. - :ref:`bool<class_bool>` **has_redo** **(** **)** |const|
  1203. Returns ``true`` if a "redo" action is available.
  1204. ----
  1205. .. _class_TextEdit_method_has_selection:
  1206. - :ref:`bool<class_bool>` **has_selection** **(** **)** |const|
  1207. Returns ``true`` if the user has selected text.
  1208. ----
  1209. .. _class_TextEdit_method_has_undo:
  1210. - :ref:`bool<class_bool>` **has_undo** **(** **)** |const|
  1211. Returns ``true`` if an "undo" action is available.
  1212. ----
  1213. .. _class_TextEdit_method_insert_line_at:
  1214. - void **insert_line_at** **(** :ref:`int<class_int>` line, :ref:`String<class_String>` text **)**
  1215. Inserts a new line with ``text`` at ``line``.
  1216. ----
  1217. .. _class_TextEdit_method_insert_text_at_caret:
  1218. - void **insert_text_at_caret** **(** :ref:`String<class_String>` text **)**
  1219. Insert the specified text at the caret position.
  1220. ----
  1221. .. _class_TextEdit_method_is_caret_visible:
  1222. - :ref:`bool<class_bool>` **is_caret_visible** **(** **)** |const|
  1223. Returns ``true`` if the caret is visible on the screen.
  1224. ----
  1225. .. _class_TextEdit_method_is_dragging_cursor:
  1226. - :ref:`bool<class_bool>` **is_dragging_cursor** **(** **)** |const|
  1227. Returns ``true`` if the user is dragging their mouse for scrolling or selecting.
  1228. ----
  1229. .. _class_TextEdit_method_is_gutter_clickable:
  1230. - :ref:`bool<class_bool>` **is_gutter_clickable** **(** :ref:`int<class_int>` gutter **)** |const|
  1231. Returns whether the gutter is clickable.
  1232. ----
  1233. .. _class_TextEdit_method_is_gutter_drawn:
  1234. - :ref:`bool<class_bool>` **is_gutter_drawn** **(** :ref:`int<class_int>` gutter **)** |const|
  1235. Returns whether the gutter is currently drawn.
  1236. ----
  1237. .. _class_TextEdit_method_is_gutter_overwritable:
  1238. - :ref:`bool<class_bool>` **is_gutter_overwritable** **(** :ref:`int<class_int>` gutter **)** |const|
  1239. Returns whether the gutter is overwritable.
  1240. ----
  1241. .. _class_TextEdit_method_is_line_gutter_clickable:
  1242. - :ref:`bool<class_bool>` **is_line_gutter_clickable** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
  1243. Returns whether the gutter on the given line is clickable.
  1244. ----
  1245. .. _class_TextEdit_method_is_line_wrapped:
  1246. - :ref:`bool<class_bool>` **is_line_wrapped** **(** :ref:`int<class_int>` line **)** |const|
  1247. Returns if the given line is wrapped.
  1248. ----
  1249. .. _class_TextEdit_method_is_menu_visible:
  1250. - :ref:`bool<class_bool>` **is_menu_visible** **(** **)** |const|
  1251. Returns whether the menu is visible. Use this instead of ``get_menu().visible`` to improve performance (so the creation of the menu is avoided).
  1252. ----
  1253. .. _class_TextEdit_method_is_mouse_over_selection:
  1254. - :ref:`bool<class_bool>` **is_mouse_over_selection** **(** :ref:`bool<class_bool>` edges **)** |const|
  1255. Returns whether the mouse is over selection. If ``edges`` is ``true``, the edges are considered part of the selection.
  1256. ----
  1257. .. _class_TextEdit_method_is_overtype_mode_enabled:
  1258. - :ref:`bool<class_bool>` **is_overtype_mode_enabled** **(** **)** |const|
  1259. Returns whether the user is in overtype mode.
  1260. ----
  1261. .. _class_TextEdit_method_menu_option:
  1262. - void **menu_option** **(** :ref:`int<class_int>` option **)**
  1263. Triggers a right-click menu action by the specified index. See :ref:`MenuItems<enum_TextEdit_MenuItems>` for a list of available indexes.
  1264. ----
  1265. .. _class_TextEdit_method_merge_gutters:
  1266. - void **merge_gutters** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)**
  1267. Merge the gutters from ``from_line`` into ``to_line``. Only overwritable gutters will be copied.
  1268. ----
  1269. .. _class_TextEdit_method_paste:
  1270. - void **paste** **(** **)**
  1271. Paste at the current location. Can be overridden with :ref:`_paste<class_TextEdit_method__paste>`.
  1272. ----
  1273. .. _class_TextEdit_method_redo:
  1274. - void **redo** **(** **)**
  1275. Perform redo operation.
  1276. ----
  1277. .. _class_TextEdit_method_remove_gutter:
  1278. - void **remove_gutter** **(** :ref:`int<class_int>` gutter **)**
  1279. Removes the gutter from this ``TextEdit``.
  1280. ----
  1281. .. _class_TextEdit_method_remove_text:
  1282. - void **remove_text** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_column **)**
  1283. Removes text between the given positions.
  1284. \ **Note:** This does not adjust the caret or selection, which as a result it can end up in an invalid position.
  1285. ----
  1286. .. _class_TextEdit_method_search:
  1287. - :ref:`Vector2i<class_Vector2i>` **search** **(** :ref:`String<class_String>` text, :ref:`int<class_int>` flags, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_colum **)** |const|
  1288. Perform a search inside the text. Search flags can be specified in the :ref:`SearchFlags<enum_TextEdit_SearchFlags>` enum.
  1289. In the returned vector, ``x`` is the column, ``y`` is the line. If no results are found, both are equal to ``-1``.
  1290. .. tabs::
  1291. .. code-tab:: gdscript
  1292. var result = search("print", SEARCH_WHOLE_WORDS, 0, 0)
  1293. if result.x != -1:
  1294. # Result found.
  1295. var line_number = result.y
  1296. var column_number = result.x
  1297. .. code-tab:: csharp
  1298. Vector2i result = Search("print", (uint)TextEdit.SearchFlags.WholeWords, 0, 0);
  1299. if (result.Length > 0)
  1300. {
  1301. // Result found.
  1302. int lineNumber = result.y;
  1303. int columnNumber = result.x;
  1304. }
  1305. ----
  1306. .. _class_TextEdit_method_select:
  1307. - void **select** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_column **)**
  1308. Perform selection, from line/column to line/column.
  1309. If :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` is ``false``, no selection will occur.
  1310. ----
  1311. .. _class_TextEdit_method_select_all:
  1312. - void **select_all** **(** **)**
  1313. Select all the text.
  1314. If :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` is ``false``, no selection will occur.
  1315. ----
  1316. .. _class_TextEdit_method_select_word_under_caret:
  1317. - void **select_word_under_caret** **(** **)**
  1318. Selects the word under the caret.
  1319. ----
  1320. .. _class_TextEdit_method_set_caret_column:
  1321. - void **set_caret_column** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)**
  1322. Moves the caret to the specified ``column`` index.
  1323. If ``adjust_viewport`` is ``true``, the viewport will center at the caret position after the move occurs.
  1324. ----
  1325. .. _class_TextEdit_method_set_caret_line:
  1326. - void **set_caret_line** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` adjust_viewport=true, :ref:`bool<class_bool>` can_be_hidden=true, :ref:`int<class_int>` wrap_index=0 **)**
  1327. Moves the caret to the specified ``line`` index.
  1328. If ``adjust_viewport`` is ``true``, the viewport will center at the caret position after the move occurs.
  1329. If ``can_be_hidden`` is ``true``, the specified ``line`` can be hidden.
  1330. ----
  1331. .. _class_TextEdit_method_set_gutter_clickable:
  1332. - void **set_gutter_clickable** **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` clickable **)**
  1333. Sets the gutter as clickable. This will change the mouse cursor to a pointing hand when hovering over the gutter.
  1334. ----
  1335. .. _class_TextEdit_method_set_gutter_custom_draw:
  1336. - void **set_gutter_custom_draw** **(** :ref:`int<class_int>` column, :ref:`Callable<class_Callable>` draw_callback **)**
  1337. Set a custom draw method for the gutter. The callback method must take the following args: ``line: int, gutter: int, Area: Rect2``.
  1338. ----
  1339. .. _class_TextEdit_method_set_gutter_draw:
  1340. - void **set_gutter_draw** **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` draw **)**
  1341. Sets whether the gutter should be drawn.
  1342. ----
  1343. .. _class_TextEdit_method_set_gutter_name:
  1344. - void **set_gutter_name** **(** :ref:`int<class_int>` gutter, :ref:`String<class_String>` name **)**
  1345. Sets the name of the gutter.
  1346. ----
  1347. .. _class_TextEdit_method_set_gutter_overwritable:
  1348. - void **set_gutter_overwritable** **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` overwritable **)**
  1349. Sets the gutter to overwritable. See :ref:`merge_gutters<class_TextEdit_method_merge_gutters>`.
  1350. ----
  1351. .. _class_TextEdit_method_set_gutter_type:
  1352. - void **set_gutter_type** **(** :ref:`int<class_int>` gutter, :ref:`GutterType<enum_TextEdit_GutterType>` type **)**
  1353. Sets the type of gutter.
  1354. ----
  1355. .. _class_TextEdit_method_set_gutter_width:
  1356. - void **set_gutter_width** **(** :ref:`int<class_int>` gutter, :ref:`int<class_int>` width **)**
  1357. Set the width of the gutter.
  1358. ----
  1359. .. _class_TextEdit_method_set_line:
  1360. - void **set_line** **(** :ref:`int<class_int>` line, :ref:`String<class_String>` new_text **)**
  1361. Sets the text for a specific line.
  1362. ----
  1363. .. _class_TextEdit_method_set_line_as_center_visible:
  1364. - void **set_line_as_center_visible** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)**
  1365. Positions the ``wrap_index`` of ``line`` at the center of the viewport.
  1366. ----
  1367. .. _class_TextEdit_method_set_line_as_first_visible:
  1368. - void **set_line_as_first_visible** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)**
  1369. Positions the ``wrap_index`` of ``line`` at the top of the viewport.
  1370. ----
  1371. .. _class_TextEdit_method_set_line_as_last_visible:
  1372. - void **set_line_as_last_visible** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)**
  1373. Positions the ``wrap_index`` of ``line`` at the bottom of the viewport.
  1374. ----
  1375. .. _class_TextEdit_method_set_line_background_color:
  1376. - void **set_line_background_color** **(** :ref:`int<class_int>` line, :ref:`Color<class_Color>` color **)**
  1377. Sets the current background color of the line. Set to ``Color(0, 0, 0, 0)`` for no color.
  1378. ----
  1379. .. _class_TextEdit_method_set_line_gutter_clickable:
  1380. - void **set_line_gutter_clickable** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` clickable **)**
  1381. Sets the ``gutter`` on ``line`` as clickable.
  1382. ----
  1383. .. _class_TextEdit_method_set_line_gutter_icon:
  1384. - void **set_line_gutter_icon** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Texture2D<class_Texture2D>` icon **)**
  1385. Sets the icon for ``gutter`` on ``line``.
  1386. ----
  1387. .. _class_TextEdit_method_set_line_gutter_item_color:
  1388. - void **set_line_gutter_item_color** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Color<class_Color>` color **)**
  1389. Sets the color for ``gutter`` on ``line``.
  1390. ----
  1391. .. _class_TextEdit_method_set_line_gutter_metadata:
  1392. - void **set_line_gutter_metadata** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Variant<class_Variant>` metadata **)**
  1393. Sets the metadata for ``gutter`` on ``line``.
  1394. ----
  1395. .. _class_TextEdit_method_set_line_gutter_text:
  1396. - void **set_line_gutter_text** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`String<class_String>` text **)**
  1397. Sets the text for ``gutter`` on ``line``.
  1398. ----
  1399. .. _class_TextEdit_method_set_opentype_feature:
  1400. - void **set_opentype_feature** **(** :ref:`String<class_String>` tag, :ref:`int<class_int>` value **)**
  1401. Sets OpenType feature ``tag``. More info: `OpenType feature tags <https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags>`__.
  1402. ----
  1403. .. _class_TextEdit_method_set_overtype_mode_enabled:
  1404. - void **set_overtype_mode_enabled** **(** :ref:`bool<class_bool>` enabled **)**
  1405. If ``true``, sets the user into overtype mode. When the user types in this mode, it will override existing text.
  1406. ----
  1407. .. _class_TextEdit_method_set_search_flags:
  1408. - void **set_search_flags** **(** :ref:`int<class_int>` flags **)**
  1409. Sets the search flags. This is used with :ref:`set_search_text<class_TextEdit_method_set_search_text>` to highlight occurrences of the searched text. Search flags can be specified from the :ref:`SearchFlags<enum_TextEdit_SearchFlags>` enum.
  1410. ----
  1411. .. _class_TextEdit_method_set_search_text:
  1412. - void **set_search_text** **(** :ref:`String<class_String>` search_text **)**
  1413. Sets the search text. See :ref:`set_search_flags<class_TextEdit_method_set_search_flags>`.
  1414. ----
  1415. .. _class_TextEdit_method_set_selection_mode:
  1416. - void **set_selection_mode** **(** :ref:`SelectionMode<enum_TextEdit_SelectionMode>` mode, :ref:`int<class_int>` line=-1, :ref:`int<class_int>` column=-1 **)**
  1417. Sets the current selection mode.
  1418. ----
  1419. .. _class_TextEdit_method_set_tab_size:
  1420. - void **set_tab_size** **(** :ref:`int<class_int>` size **)**
  1421. Sets the tab size for the ``TextEdit`` to use.
  1422. ----
  1423. .. _class_TextEdit_method_set_tooltip_request_func:
  1424. - void **set_tooltip_request_func** **(** :ref:`Callable<class_Callable>` callback **)**
  1425. Provide custom tooltip text. The callback method must take the following args: ``hovered_word: String``
  1426. ----
  1427. .. _class_TextEdit_method_swap_lines:
  1428. - void **swap_lines** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)**
  1429. Swaps the two lines.
  1430. ----
  1431. .. _class_TextEdit_method_tag_saved_version:
  1432. - void **tag_saved_version** **(** **)**
  1433. Tag the current version as saved.
  1434. ----
  1435. .. _class_TextEdit_method_undo:
  1436. - void **undo** **(** **)**
  1437. Perform undo operation.
  1438. Theme Property Descriptions
  1439. ---------------------------
  1440. .. _class_TextEdit_theme_color_background_color:
  1441. - :ref:`Color<class_Color>` **background_color**
  1442. +-----------+-----------------------+
  1443. | *Default* | ``Color(0, 0, 0, 0)`` |
  1444. +-----------+-----------------------+
  1445. Sets the background :ref:`Color<class_Color>` of this ``TextEdit``.
  1446. ----
  1447. .. _class_TextEdit_theme_color_caret_background_color:
  1448. - :ref:`Color<class_Color>` **caret_background_color**
  1449. +-----------+-----------------------+
  1450. | *Default* | ``Color(0, 0, 0, 1)`` |
  1451. +-----------+-----------------------+
  1452. :ref:`Color<class_Color>` of the text behind the caret when using a block caret.
  1453. ----
  1454. .. _class_TextEdit_theme_color_caret_color:
  1455. - :ref:`Color<class_Color>` **caret_color**
  1456. +-----------+-----------------------------------+
  1457. | *Default* | ``Color(0.875, 0.875, 0.875, 1)`` |
  1458. +-----------+-----------------------------------+
  1459. :ref:`Color<class_Color>` of the caret. This can be set to a fully transparent color to hide the caret entirely.
  1460. ----
  1461. .. _class_TextEdit_theme_color_current_line_color:
  1462. - :ref:`Color<class_Color>` **current_line_color**
  1463. +-----------+----------------------------------+
  1464. | *Default* | ``Color(0.25, 0.25, 0.26, 0.8)`` |
  1465. +-----------+----------------------------------+
  1466. Background :ref:`Color<class_Color>` of the line containing the caret.
  1467. ----
  1468. .. _class_TextEdit_theme_color_font_color:
  1469. - :ref:`Color<class_Color>` **font_color**
  1470. +-----------+-----------------------------------+
  1471. | *Default* | ``Color(0.875, 0.875, 0.875, 1)`` |
  1472. +-----------+-----------------------------------+
  1473. Sets the font :ref:`Color<class_Color>`.
  1474. ----
  1475. .. _class_TextEdit_theme_color_font_outline_color:
  1476. - :ref:`Color<class_Color>` **font_outline_color**
  1477. +-----------+-----------------------+
  1478. | *Default* | ``Color(1, 1, 1, 1)`` |
  1479. +-----------+-----------------------+
  1480. The tint of text outline of the ``TextEdit``.
  1481. ----
  1482. .. _class_TextEdit_theme_color_font_placeholder_color:
  1483. - :ref:`Color<class_Color>` **font_placeholder_color**
  1484. +-----------+-------------------------------------+
  1485. | *Default* | ``Color(0.875, 0.875, 0.875, 0.6)`` |
  1486. +-----------+-------------------------------------+
  1487. Font color for :ref:`placeholder_text<class_TextEdit_property_placeholder_text>`.
  1488. ----
  1489. .. _class_TextEdit_theme_color_font_readonly_color:
  1490. - :ref:`Color<class_Color>` **font_readonly_color**
  1491. +-----------+-------------------------------------+
  1492. | *Default* | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  1493. +-----------+-------------------------------------+
  1494. Sets the font :ref:`Color<class_Color>` when :ref:`editable<class_TextEdit_property_editable>` is disabled.
  1495. ----
  1496. .. _class_TextEdit_theme_color_font_selected_color:
  1497. - :ref:`Color<class_Color>` **font_selected_color**
  1498. +-----------+-----------------------+
  1499. | *Default* | ``Color(1, 1, 1, 1)`` |
  1500. +-----------+-----------------------+
  1501. Sets the :ref:`Color<class_Color>` of the selected text. :ref:`override_selected_font_color<class_TextEdit_property_override_selected_font_color>` has to be enabled.
  1502. ----
  1503. .. _class_TextEdit_theme_color_search_result_border_color:
  1504. - :ref:`Color<class_Color>` **search_result_border_color**
  1505. +-----------+-------------------------------+
  1506. | *Default* | ``Color(0.3, 0.3, 0.3, 0.4)`` |
  1507. +-----------+-------------------------------+
  1508. :ref:`Color<class_Color>` of the border around text that matches the search query.
  1509. ----
  1510. .. _class_TextEdit_theme_color_search_result_color:
  1511. - :ref:`Color<class_Color>` **search_result_color**
  1512. +-----------+-----------------------------+
  1513. | *Default* | ``Color(0.3, 0.3, 0.3, 1)`` |
  1514. +-----------+-----------------------------+
  1515. :ref:`Color<class_Color>` behind the text that matches the search query.
  1516. ----
  1517. .. _class_TextEdit_theme_color_selection_color:
  1518. - :ref:`Color<class_Color>` **selection_color**
  1519. +-----------+-----------------------------+
  1520. | *Default* | ``Color(0.5, 0.5, 0.5, 1)`` |
  1521. +-----------+-----------------------------+
  1522. Sets the highlight :ref:`Color<class_Color>` of text selections.
  1523. ----
  1524. .. _class_TextEdit_theme_color_word_highlighted_color:
  1525. - :ref:`Color<class_Color>` **word_highlighted_color**
  1526. +-----------+--------------------------------+
  1527. | *Default* | ``Color(0.5, 0.5, 0.5, 0.25)`` |
  1528. +-----------+--------------------------------+
  1529. Sets the highlight :ref:`Color<class_Color>` of multiple occurrences. :ref:`highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` has to be enabled.
  1530. ----
  1531. .. _class_TextEdit_theme_constant_caret_width:
  1532. - :ref:`int<class_int>` **caret_width**
  1533. +-----------+-------+
  1534. | *Default* | ``1`` |
  1535. +-----------+-------+
  1536. 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 ``0`` or lower, the caret width is automatically set to 1 pixel and multiplied by the display scaling factor.
  1537. ----
  1538. .. _class_TextEdit_theme_constant_line_spacing:
  1539. - :ref:`int<class_int>` **line_spacing**
  1540. +-----------+-------+
  1541. | *Default* | ``4`` |
  1542. +-----------+-------+
  1543. Sets the spacing between the lines.
  1544. ----
  1545. .. _class_TextEdit_theme_constant_outline_size:
  1546. - :ref:`int<class_int>` **outline_size**
  1547. +-----------+-------+
  1548. | *Default* | ``0`` |
  1549. +-----------+-------+
  1550. The size of the text outline.
  1551. ----
  1552. .. _class_TextEdit_theme_font_font:
  1553. - :ref:`Font<class_Font>` **font**
  1554. Sets the default :ref:`Font<class_Font>`.
  1555. ----
  1556. .. _class_TextEdit_theme_font_size_font_size:
  1557. - :ref:`int<class_int>` **font_size**
  1558. Sets default font size.
  1559. ----
  1560. .. _class_TextEdit_theme_icon_space:
  1561. - :ref:`Texture2D<class_Texture2D>` **space**
  1562. Sets a custom :ref:`Texture2D<class_Texture2D>` for space text characters.
  1563. ----
  1564. .. _class_TextEdit_theme_icon_tab:
  1565. - :ref:`Texture2D<class_Texture2D>` **tab**
  1566. Sets a custom :ref:`Texture2D<class_Texture2D>` for tab text characters.
  1567. ----
  1568. .. _class_TextEdit_theme_style_focus:
  1569. - :ref:`StyleBox<class_StyleBox>` **focus**
  1570. Sets the :ref:`StyleBox<class_StyleBox>` when in focus. The ``focus`` :ref:`StyleBox<class_StyleBox>` is displayed *over* the base :ref:`StyleBox<class_StyleBox>`, so a partially transparent :ref:`StyleBox<class_StyleBox>` should be used to ensure the base :ref:`StyleBox<class_StyleBox>` remains visible. A :ref:`StyleBox<class_StyleBox>` that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
  1571. ----
  1572. .. _class_TextEdit_theme_style_normal:
  1573. - :ref:`StyleBox<class_StyleBox>` **normal**
  1574. Sets the :ref:`StyleBox<class_StyleBox>` of this ``TextEdit``.
  1575. ----
  1576. .. _class_TextEdit_theme_style_read_only:
  1577. - :ref:`StyleBox<class_StyleBox>` **read_only**
  1578. Sets the :ref:`StyleBox<class_StyleBox>` of this ``TextEdit`` when :ref:`editable<class_TextEdit_property_editable>` is disabled.
  1579. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1580. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1581. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1582. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1583. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1584. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`