class_textedit.rst 158 KB

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