class_textedit.rst 98 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775
  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. Multiline text editing control.
  10. Description
  11. -----------
  12. 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.
  13. **Note:** When holding down ``Alt``, the vertical scroll wheel will scroll 5 times as fast as it would normally do. This also works in the Godot script editor.
  14. Properties
  15. ----------
  16. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`bookmark_gutter<class_TextEdit_property_bookmark_gutter>` | ``false`` |
  18. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`breakpoint_gutter<class_TextEdit_property_breakpoint_gutter>` | ``false`` |
  20. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`caret_blink<class_TextEdit_property_caret_blink>` | ``false`` |
  22. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  23. | :ref:`float<class_float>` | :ref:`caret_blink_speed<class_TextEdit_property_caret_blink_speed>` | ``0.65`` |
  24. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`caret_block_mode<class_TextEdit_property_caret_block_mode>` | ``false`` |
  26. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`caret_moving_by_right_click<class_TextEdit_property_caret_moving_by_right_click>` | ``true`` |
  28. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_TextEdit_property_context_menu_enabled>` | ``true`` |
  30. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`draw_spaces<class_TextEdit_property_draw_spaces>` | ``false`` |
  32. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`draw_tabs<class_TextEdit_property_draw_tabs>` | ``false`` |
  34. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  35. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` *(parent override)* |
  36. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`fold_gutter<class_TextEdit_property_fold_gutter>` | ``false`` |
  38. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`hiding_enabled<class_TextEdit_property_hiding_enabled>` | ``false`` |
  40. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` | ``false`` |
  42. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`highlight_current_line<class_TextEdit_property_highlight_current_line>` | ``false`` |
  44. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  45. | :ref:`bool<class_bool>` | :ref:`minimap_draw<class_TextEdit_property_minimap_draw>` | ``false`` |
  46. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  47. | :ref:`int<class_int>` | :ref:`minimap_width<class_TextEdit_property_minimap_width>` | ``80`` |
  48. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  49. | :ref:`CursorShape<enum_Control_CursorShape>` | mouse_default_cursor_shape | ``1`` *(parent override)* |
  50. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`override_selected_font_color<class_TextEdit_property_override_selected_font_color>` | ``false`` |
  52. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  53. | :ref:`bool<class_bool>` | :ref:`readonly<class_TextEdit_property_readonly>` | ``false`` |
  54. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  55. | :ref:`int<class_int>` | :ref:`scroll_horizontal<class_TextEdit_property_scroll_horizontal>` | ``0`` |
  56. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  57. | :ref:`float<class_float>` | :ref:`scroll_vertical<class_TextEdit_property_scroll_vertical>` | ``0.0`` |
  58. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  59. | :ref:`bool<class_bool>` | :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` | ``true`` |
  60. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_TextEdit_property_shortcut_keys_enabled>` | ``true`` |
  62. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  63. | :ref:`bool<class_bool>` | :ref:`show_line_numbers<class_TextEdit_property_show_line_numbers>` | ``false`` |
  64. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  65. | :ref:`bool<class_bool>` | :ref:`smooth_scrolling<class_TextEdit_property_smooth_scrolling>` | ``false`` |
  66. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  67. | :ref:`bool<class_bool>` | :ref:`syntax_highlighting<class_TextEdit_property_syntax_highlighting>` | ``false`` |
  68. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  69. | :ref:`String<class_String>` | :ref:`text<class_TextEdit_property_text>` | ``""`` |
  70. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  71. | :ref:`float<class_float>` | :ref:`v_scroll_speed<class_TextEdit_property_v_scroll_speed>` | ``80.0`` |
  72. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  73. | :ref:`bool<class_bool>` | :ref:`virtual_keyboard_enabled<class_TextEdit_property_virtual_keyboard_enabled>` | ``true`` |
  74. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  75. | :ref:`bool<class_bool>` | :ref:`wrap_enabled<class_TextEdit_property_wrap_enabled>` | ``false`` |
  76. +----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+
  77. Methods
  78. -------
  79. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`add_color_region<class_TextEdit_method_add_color_region>` **(** :ref:`String<class_String>` begin_key, :ref:`String<class_String>` end_key, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` line_only=false **)** |
  81. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`add_keyword_color<class_TextEdit_method_add_keyword_color>` **(** :ref:`String<class_String>` keyword, :ref:`Color<class_Color>` color **)** |
  83. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`bool<class_bool>` | :ref:`can_fold<class_TextEdit_method_can_fold>` **(** :ref:`int<class_int>` line **)** |const| |
  85. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | void | :ref:`center_viewport_to_cursor<class_TextEdit_method_center_viewport_to_cursor>` **(** **)** |
  87. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | void | :ref:`clear_colors<class_TextEdit_method_clear_colors>` **(** **)** |
  89. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | void | :ref:`clear_undo_history<class_TextEdit_method_clear_undo_history>` **(** **)** |
  91. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | void | :ref:`copy<class_TextEdit_method_copy>` **(** **)** |
  93. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`int<class_int>` | :ref:`cursor_get_column<class_TextEdit_method_cursor_get_column>` **(** **)** |const| |
  95. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`int<class_int>` | :ref:`cursor_get_line<class_TextEdit_method_cursor_get_line>` **(** **)** |const| |
  97. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | void | :ref:`cursor_set_column<class_TextEdit_method_cursor_set_column>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)** |
  99. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | void | :ref:`cursor_set_line<class_TextEdit_method_cursor_set_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 **)** |
  101. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | void | :ref:`cut<class_TextEdit_method_cut>` **(** **)** |
  103. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | void | :ref:`deselect<class_TextEdit_method_deselect>` **(** **)** |
  105. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | void | :ref:`fold_all_lines<class_TextEdit_method_fold_all_lines>` **(** **)** |
  107. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | void | :ref:`fold_line<class_TextEdit_method_fold_line>` **(** :ref:`int<class_int>` line **)** |
  109. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`Array<class_Array>` | :ref:`get_breakpoints<class_TextEdit_method_get_breakpoints>` **(** **)** |const| |
  111. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`Color<class_Color>` | :ref:`get_keyword_color<class_TextEdit_method_get_keyword_color>` **(** :ref:`String<class_String>` keyword **)** |const| |
  113. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`String<class_String>` | :ref:`get_line<class_TextEdit_method_get_line>` **(** :ref:`int<class_int>` line **)** |const| |
  115. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`Vector2<class_Vector2>` | :ref:`get_line_column_at_pos<class_TextEdit_method_get_line_column_at_pos>` **(** :ref:`Vector2<class_Vector2>` position **)** |const| |
  117. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`int<class_int>` | :ref:`get_line_count<class_TextEdit_method_get_line_count>` **(** **)** |const| |
  119. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`int<class_int>` | :ref:`get_line_height<class_TextEdit_method_get_line_height>` **(** **)** |const| |
  121. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :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| |
  123. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`int<class_int>` | :ref:`get_line_wrap_count<class_TextEdit_method_get_line_wrap_count>` **(** :ref:`int<class_int>` line **)** |const| |
  125. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_line_wrapped_text<class_TextEdit_method_get_line_wrapped_text>` **(** :ref:`int<class_int>` line **)** |const| |
  127. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_TextEdit_method_get_menu>` **(** **)** |const| |
  129. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`Vector2<class_Vector2>` | :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| |
  131. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`Rect2<class_Rect2>` | :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| |
  133. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | :ref:`int<class_int>` | :ref:`get_selection_from_column<class_TextEdit_method_get_selection_from_column>` **(** **)** |const| |
  135. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | :ref:`int<class_int>` | :ref:`get_selection_from_line<class_TextEdit_method_get_selection_from_line>` **(** **)** |const| |
  137. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | :ref:`String<class_String>` | :ref:`get_selection_text<class_TextEdit_method_get_selection_text>` **(** **)** |const| |
  139. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | :ref:`int<class_int>` | :ref:`get_selection_to_column<class_TextEdit_method_get_selection_to_column>` **(** **)** |const| |
  141. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | :ref:`int<class_int>` | :ref:`get_selection_to_line<class_TextEdit_method_get_selection_to_line>` **(** **)** |const| |
  143. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | :ref:`int<class_int>` | :ref:`get_total_gutter_width<class_TextEdit_method_get_total_gutter_width>` **(** **)** |const| |
  145. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | :ref:`String<class_String>` | :ref:`get_word_under_cursor<class_TextEdit_method_get_word_under_cursor>` **(** **)** |const| |
  147. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | :ref:`bool<class_bool>` | :ref:`has_keyword_color<class_TextEdit_method_has_keyword_color>` **(** :ref:`String<class_String>` keyword **)** |const| |
  149. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | :ref:`bool<class_bool>` | :ref:`has_redo<class_TextEdit_method_has_redo>` **(** **)** |const| |
  151. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | :ref:`bool<class_bool>` | :ref:`has_undo<class_TextEdit_method_has_undo>` **(** **)** |const| |
  153. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | void | :ref:`insert_text_at_cursor<class_TextEdit_method_insert_text_at_cursor>` **(** :ref:`String<class_String>` text **)** |
  155. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | :ref:`bool<class_bool>` | :ref:`is_folded<class_TextEdit_method_is_folded>` **(** :ref:`int<class_int>` line **)** |const| |
  157. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`bool<class_bool>` | :ref:`is_line_hidden<class_TextEdit_method_is_line_hidden>` **(** :ref:`int<class_int>` line **)** |const| |
  159. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`bool<class_bool>` | :ref:`is_line_set_as_bookmark<class_TextEdit_method_is_line_set_as_bookmark>` **(** :ref:`int<class_int>` line **)** |const| |
  161. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`bool<class_bool>` | :ref:`is_line_set_as_breakpoint<class_TextEdit_method_is_line_set_as_breakpoint>` **(** :ref:`int<class_int>` line **)** |const| |
  163. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`bool<class_bool>` | :ref:`is_line_set_as_safe<class_TextEdit_method_is_line_set_as_safe>` **(** :ref:`int<class_int>` line **)** |const| |
  165. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`bool<class_bool>` | :ref:`is_line_wrapped<class_TextEdit_method_is_line_wrapped>` **(** :ref:`int<class_int>` line **)** |const| |
  167. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | :ref:`bool<class_bool>` | :ref:`is_selection_active<class_TextEdit_method_is_selection_active>` **(** **)** |const| |
  169. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | void | :ref:`menu_option<class_TextEdit_method_menu_option>` **(** :ref:`int<class_int>` option **)** |
  171. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | void | :ref:`paste<class_TextEdit_method_paste>` **(** **)** |
  173. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | void | :ref:`redo<class_TextEdit_method_redo>` **(** **)** |
  175. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | void | :ref:`remove_breakpoints<class_TextEdit_method_remove_breakpoints>` **(** **)** |
  177. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`search<class_TextEdit_method_search>` **(** :ref:`String<class_String>` key, :ref:`int<class_int>` flags, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column **)** |const| |
  179. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | 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 **)** |
  181. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | void | :ref:`select_all<class_TextEdit_method_select_all>` **(** **)** |
  183. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | void | :ref:`set_line<class_TextEdit_method_set_line>` **(** :ref:`int<class_int>` line, :ref:`String<class_String>` new_text **)** |
  185. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | void | :ref:`set_line_as_bookmark<class_TextEdit_method_set_line_as_bookmark>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` bookmark **)** |
  187. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | void | :ref:`set_line_as_breakpoint<class_TextEdit_method_set_line_as_breakpoint>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` breakpoint **)** |
  189. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | void | :ref:`set_line_as_hidden<class_TextEdit_method_set_line_as_hidden>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` enable **)** |
  191. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | void | :ref:`set_line_as_safe<class_TextEdit_method_set_line_as_safe>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` safe **)** |
  193. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | void | :ref:`toggle_fold_line<class_TextEdit_method_toggle_fold_line>` **(** :ref:`int<class_int>` line **)** |
  195. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | void | :ref:`undo<class_TextEdit_method_undo>` **(** **)** |
  197. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | void | :ref:`unfold_line<class_TextEdit_method_unfold_line>` **(** :ref:`int<class_int>` line **)** |
  199. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | void | :ref:`unhide_all_lines<class_TextEdit_method_unhide_all_lines>` **(** **)** |
  201. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. Theme Properties
  203. ----------------
  204. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  205. | :ref:`Color<class_Color>` | :ref:`background_color<class_TextEdit_theme_color_background_color>` | ``Color( 0, 0, 0, 0 )`` |
  206. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  207. | :ref:`Color<class_Color>` | :ref:`bookmark_color<class_TextEdit_theme_color_bookmark_color>` | ``Color( 0.08, 0.49, 0.98, 1 )`` |
  208. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  209. | :ref:`Color<class_Color>` | :ref:`brace_mismatch_color<class_TextEdit_theme_color_brace_mismatch_color>` | ``Color( 1, 0.2, 0.2, 1 )`` |
  210. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  211. | :ref:`Color<class_Color>` | :ref:`breakpoint_color<class_TextEdit_theme_color_breakpoint_color>` | ``Color( 0.8, 0.8, 0.4, 0.2 )`` |
  212. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  213. | :ref:`Color<class_Color>` | :ref:`caret_background_color<class_TextEdit_theme_color_caret_background_color>` | ``Color( 0, 0, 0, 1 )`` |
  214. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  215. | :ref:`Color<class_Color>` | :ref:`caret_color<class_TextEdit_theme_color_caret_color>` | ``Color( 0.88, 0.88, 0.88, 1 )`` |
  216. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  217. | :ref:`Color<class_Color>` | :ref:`code_folding_color<class_TextEdit_theme_color_code_folding_color>` | ``Color( 0.8, 0.8, 0.8, 0.8 )`` |
  218. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  219. | :ref:`Color<class_Color>` | :ref:`completion_background_color<class_TextEdit_theme_color_completion_background_color>` | ``Color( 0.17, 0.16, 0.2, 1 )`` |
  220. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  221. | :ref:`Color<class_Color>` | :ref:`completion_existing_color<class_TextEdit_theme_color_completion_existing_color>` | ``Color( 0.87, 0.87, 0.87, 0.13 )`` |
  222. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  223. | :ref:`Color<class_Color>` | :ref:`completion_font_color<class_TextEdit_theme_color_completion_font_color>` | ``Color( 0.67, 0.67, 0.67, 1 )`` |
  224. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  225. | :ref:`Color<class_Color>` | :ref:`completion_scroll_color<class_TextEdit_theme_color_completion_scroll_color>` | ``Color( 1, 1, 1, 1 )`` |
  226. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  227. | :ref:`Color<class_Color>` | :ref:`completion_selected_color<class_TextEdit_theme_color_completion_selected_color>` | ``Color( 0.26, 0.26, 0.27, 1 )`` |
  228. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  229. | :ref:`Color<class_Color>` | :ref:`current_line_color<class_TextEdit_theme_color_current_line_color>` | ``Color( 0.25, 0.25, 0.26, 0.8 )`` |
  230. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  231. | :ref:`Color<class_Color>` | :ref:`executing_line_color<class_TextEdit_theme_color_executing_line_color>` | ``Color( 0.2, 0.8, 0.2, 0.4 )`` |
  232. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  233. | :ref:`Color<class_Color>` | :ref:`font_color<class_TextEdit_theme_color_font_color>` | ``Color( 0.88, 0.88, 0.88, 1 )`` |
  234. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  235. | :ref:`Color<class_Color>` | :ref:`font_color_readonly<class_TextEdit_theme_color_font_color_readonly>` | ``Color( 0.88, 0.88, 0.88, 0.5 )`` |
  236. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  237. | :ref:`Color<class_Color>` | :ref:`font_color_selected<class_TextEdit_theme_color_font_color_selected>` | ``Color( 0, 0, 0, 1 )`` |
  238. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  239. | :ref:`Color<class_Color>` | :ref:`function_color<class_TextEdit_theme_color_function_color>` | ``Color( 0.4, 0.64, 0.81, 1 )`` |
  240. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  241. | :ref:`Color<class_Color>` | :ref:`line_number_color<class_TextEdit_theme_color_line_number_color>` | ``Color( 0.67, 0.67, 0.67, 0.4 )`` |
  242. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  243. | :ref:`Color<class_Color>` | :ref:`mark_color<class_TextEdit_theme_color_mark_color>` | ``Color( 1, 0.4, 0.4, 0.4 )`` |
  244. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  245. | :ref:`Color<class_Color>` | :ref:`member_variable_color<class_TextEdit_theme_color_member_variable_color>` | ``Color( 0.9, 0.31, 0.35, 1 )`` |
  246. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  247. | :ref:`Color<class_Color>` | :ref:`number_color<class_TextEdit_theme_color_number_color>` | ``Color( 0.92, 0.58, 0.2, 1 )`` |
  248. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  249. | :ref:`Color<class_Color>` | :ref:`safe_line_number_color<class_TextEdit_theme_color_safe_line_number_color>` | ``Color( 0.67, 0.78, 0.67, 0.6 )`` |
  250. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  251. | :ref:`Color<class_Color>` | :ref:`selection_color<class_TextEdit_theme_color_selection_color>` | ``Color( 0.49, 0.49, 0.49, 1 )`` |
  252. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  253. | :ref:`Color<class_Color>` | :ref:`symbol_color<class_TextEdit_theme_color_symbol_color>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  254. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  255. | :ref:`Color<class_Color>` | :ref:`word_highlighted_color<class_TextEdit_theme_color_word_highlighted_color>` | ``Color( 0.8, 0.9, 0.9, 0.15 )`` |
  256. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  257. | :ref:`int<class_int>` | :ref:`completion_lines<class_TextEdit_theme_constant_completion_lines>` | ``7`` |
  258. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  259. | :ref:`int<class_int>` | :ref:`completion_max_width<class_TextEdit_theme_constant_completion_max_width>` | ``50`` |
  260. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  261. | :ref:`int<class_int>` | :ref:`completion_scroll_width<class_TextEdit_theme_constant_completion_scroll_width>` | ``3`` |
  262. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  263. | :ref:`int<class_int>` | :ref:`line_spacing<class_TextEdit_theme_constant_line_spacing>` | ``4`` |
  264. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  265. | :ref:`Font<class_Font>` | :ref:`font<class_TextEdit_theme_font_font>` | |
  266. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  267. | :ref:`Texture<class_Texture>` | :ref:`fold<class_TextEdit_theme_icon_fold>` | |
  268. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  269. | :ref:`Texture<class_Texture>` | :ref:`folded<class_TextEdit_theme_icon_folded>` | |
  270. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  271. | :ref:`Texture<class_Texture>` | :ref:`space<class_TextEdit_theme_icon_space>` | |
  272. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  273. | :ref:`Texture<class_Texture>` | :ref:`tab<class_TextEdit_theme_icon_tab>` | |
  274. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  275. | :ref:`StyleBox<class_StyleBox>` | :ref:`completion<class_TextEdit_theme_style_completion>` | |
  276. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  277. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_TextEdit_theme_style_focus>` | |
  278. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  279. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_TextEdit_theme_style_normal>` | |
  280. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  281. | :ref:`StyleBox<class_StyleBox>` | :ref:`read_only<class_TextEdit_theme_style_read_only>` | |
  282. +---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+
  283. Signals
  284. -------
  285. .. _class_TextEdit_signal_breakpoint_toggled:
  286. - **breakpoint_toggled** **(** :ref:`int<class_int>` row **)**
  287. Emitted when a breakpoint is placed via the breakpoint gutter.
  288. ----
  289. .. _class_TextEdit_signal_cursor_changed:
  290. - **cursor_changed** **(** **)**
  291. Emitted when the cursor changes.
  292. ----
  293. .. _class_TextEdit_signal_info_clicked:
  294. - **info_clicked** **(** :ref:`int<class_int>` row, :ref:`String<class_String>` info **)**
  295. Emitted when the info icon is clicked.
  296. ----
  297. .. _class_TextEdit_signal_request_completion:
  298. - **request_completion** **(** **)**
  299. ----
  300. .. _class_TextEdit_signal_symbol_lookup:
  301. - **symbol_lookup** **(** :ref:`String<class_String>` symbol, :ref:`int<class_int>` row, :ref:`int<class_int>` column **)**
  302. ----
  303. .. _class_TextEdit_signal_text_changed:
  304. - **text_changed** **(** **)**
  305. Emitted when the text changes.
  306. Enumerations
  307. ------------
  308. .. _enum_TextEdit_SearchFlags:
  309. .. _class_TextEdit_constant_SEARCH_MATCH_CASE:
  310. .. _class_TextEdit_constant_SEARCH_WHOLE_WORDS:
  311. .. _class_TextEdit_constant_SEARCH_BACKWARDS:
  312. enum **SearchFlags**:
  313. - **SEARCH_MATCH_CASE** = **1** --- Match case when searching.
  314. - **SEARCH_WHOLE_WORDS** = **2** --- Match whole words when searching.
  315. - **SEARCH_BACKWARDS** = **4** --- Search from end to beginning.
  316. ----
  317. .. _enum_TextEdit_SearchResult:
  318. .. _class_TextEdit_constant_SEARCH_RESULT_COLUMN:
  319. .. _class_TextEdit_constant_SEARCH_RESULT_LINE:
  320. enum **SearchResult**:
  321. - **SEARCH_RESULT_COLUMN** = **0** --- Used to access the result column from :ref:`search<class_TextEdit_method_search>`.
  322. - **SEARCH_RESULT_LINE** = **1** --- Used to access the result line from :ref:`search<class_TextEdit_method_search>`.
  323. ----
  324. .. _enum_TextEdit_MenuItems:
  325. .. _class_TextEdit_constant_MENU_CUT:
  326. .. _class_TextEdit_constant_MENU_COPY:
  327. .. _class_TextEdit_constant_MENU_PASTE:
  328. .. _class_TextEdit_constant_MENU_CLEAR:
  329. .. _class_TextEdit_constant_MENU_SELECT_ALL:
  330. .. _class_TextEdit_constant_MENU_UNDO:
  331. .. _class_TextEdit_constant_MENU_REDO:
  332. .. _class_TextEdit_constant_MENU_MAX:
  333. enum **MenuItems**:
  334. - **MENU_CUT** = **0** --- Cuts (copies and clears) the selected text.
  335. - **MENU_COPY** = **1** --- Copies the selected text.
  336. - **MENU_PASTE** = **2** --- Pastes the clipboard text over the selected text (or at the cursor's position).
  337. - **MENU_CLEAR** = **3** --- Erases the whole ``TextEdit`` text.
  338. - **MENU_SELECT_ALL** = **4** --- Selects the whole ``TextEdit`` text.
  339. - **MENU_UNDO** = **5** --- Undoes the previous action.
  340. - **MENU_REDO** = **6** --- Redoes the previous action.
  341. - **MENU_MAX** = **7** --- Represents the size of the :ref:`MenuItems<enum_TextEdit_MenuItems>` enum.
  342. Property Descriptions
  343. ---------------------
  344. .. _class_TextEdit_property_bookmark_gutter:
  345. - :ref:`bool<class_bool>` **bookmark_gutter**
  346. +-----------+------------------------------------+
  347. | *Default* | ``false`` |
  348. +-----------+------------------------------------+
  349. | *Setter* | set_bookmark_gutter_enabled(value) |
  350. +-----------+------------------------------------+
  351. | *Getter* | is_bookmark_gutter_enabled() |
  352. +-----------+------------------------------------+
  353. If ``true``, the bookmark gutter is visible.
  354. ----
  355. .. _class_TextEdit_property_breakpoint_gutter:
  356. - :ref:`bool<class_bool>` **breakpoint_gutter**
  357. +-----------+--------------------------------------+
  358. | *Default* | ``false`` |
  359. +-----------+--------------------------------------+
  360. | *Setter* | set_breakpoint_gutter_enabled(value) |
  361. +-----------+--------------------------------------+
  362. | *Getter* | is_breakpoint_gutter_enabled() |
  363. +-----------+--------------------------------------+
  364. If ``true``, the breakpoint gutter is visible.
  365. ----
  366. .. _class_TextEdit_property_caret_blink:
  367. - :ref:`bool<class_bool>` **caret_blink**
  368. +-----------+---------------------------------+
  369. | *Default* | ``false`` |
  370. +-----------+---------------------------------+
  371. | *Setter* | cursor_set_blink_enabled(value) |
  372. +-----------+---------------------------------+
  373. | *Getter* | cursor_get_blink_enabled() |
  374. +-----------+---------------------------------+
  375. If ``true``, the caret (visual cursor) blinks.
  376. ----
  377. .. _class_TextEdit_property_caret_blink_speed:
  378. - :ref:`float<class_float>` **caret_blink_speed**
  379. +-----------+-------------------------------+
  380. | *Default* | ``0.65`` |
  381. +-----------+-------------------------------+
  382. | *Setter* | cursor_set_blink_speed(value) |
  383. +-----------+-------------------------------+
  384. | *Getter* | cursor_get_blink_speed() |
  385. +-----------+-------------------------------+
  386. Duration (in seconds) of a caret's blinking cycle.
  387. ----
  388. .. _class_TextEdit_property_caret_block_mode:
  389. - :ref:`bool<class_bool>` **caret_block_mode**
  390. +-----------+------------------------------+
  391. | *Default* | ``false`` |
  392. +-----------+------------------------------+
  393. | *Setter* | cursor_set_block_mode(value) |
  394. +-----------+------------------------------+
  395. | *Getter* | cursor_is_block_mode() |
  396. +-----------+------------------------------+
  397. If ``true``, the caret displays as a rectangle.
  398. If ``false``, the caret displays as a bar.
  399. ----
  400. .. _class_TextEdit_property_caret_moving_by_right_click:
  401. - :ref:`bool<class_bool>` **caret_moving_by_right_click**
  402. +-----------+------------------------------------+
  403. | *Default* | ``true`` |
  404. +-----------+------------------------------------+
  405. | *Setter* | set_right_click_moves_caret(value) |
  406. +-----------+------------------------------------+
  407. | *Getter* | is_right_click_moving_caret() |
  408. +-----------+------------------------------------+
  409. If ``true``, a right-click moves the cursor at the mouse position before displaying the context menu.
  410. If ``false``, the context menu disregards mouse location.
  411. ----
  412. .. _class_TextEdit_property_context_menu_enabled:
  413. - :ref:`bool<class_bool>` **context_menu_enabled**
  414. +-----------+---------------------------------+
  415. | *Default* | ``true`` |
  416. +-----------+---------------------------------+
  417. | *Setter* | set_context_menu_enabled(value) |
  418. +-----------+---------------------------------+
  419. | *Getter* | is_context_menu_enabled() |
  420. +-----------+---------------------------------+
  421. If ``true``, a right-click displays the context menu.
  422. ----
  423. .. _class_TextEdit_property_draw_spaces:
  424. - :ref:`bool<class_bool>` **draw_spaces**
  425. +-----------+------------------------+
  426. | *Default* | ``false`` |
  427. +-----------+------------------------+
  428. | *Setter* | set_draw_spaces(value) |
  429. +-----------+------------------------+
  430. | *Getter* | is_drawing_spaces() |
  431. +-----------+------------------------+
  432. If ``true``, the "space" character will have a visible representation.
  433. ----
  434. .. _class_TextEdit_property_draw_tabs:
  435. - :ref:`bool<class_bool>` **draw_tabs**
  436. +-----------+----------------------+
  437. | *Default* | ``false`` |
  438. +-----------+----------------------+
  439. | *Setter* | set_draw_tabs(value) |
  440. +-----------+----------------------+
  441. | *Getter* | is_drawing_tabs() |
  442. +-----------+----------------------+
  443. If ``true``, the "tab" character will have a visible representation.
  444. ----
  445. .. _class_TextEdit_property_fold_gutter:
  446. - :ref:`bool<class_bool>` **fold_gutter**
  447. +-----------+-----------------------------+
  448. | *Default* | ``false`` |
  449. +-----------+-----------------------------+
  450. | *Setter* | set_draw_fold_gutter(value) |
  451. +-----------+-----------------------------+
  452. | *Getter* | is_drawing_fold_gutter() |
  453. +-----------+-----------------------------+
  454. If ``true``, the fold gutter is visible. This enables folding groups of indented lines.
  455. ----
  456. .. _class_TextEdit_property_hiding_enabled:
  457. - :ref:`bool<class_bool>` **hiding_enabled**
  458. +-----------+---------------------------+
  459. | *Default* | ``false`` |
  460. +-----------+---------------------------+
  461. | *Setter* | set_hiding_enabled(value) |
  462. +-----------+---------------------------+
  463. | *Getter* | is_hiding_enabled() |
  464. +-----------+---------------------------+
  465. If ``true``, all lines that have been set to hidden by :ref:`set_line_as_hidden<class_TextEdit_method_set_line_as_hidden>`, will not be visible.
  466. ----
  467. .. _class_TextEdit_property_highlight_all_occurrences:
  468. - :ref:`bool<class_bool>` **highlight_all_occurrences**
  469. +-----------+----------------------------------------+
  470. | *Default* | ``false`` |
  471. +-----------+----------------------------------------+
  472. | *Setter* | set_highlight_all_occurrences(value) |
  473. +-----------+----------------------------------------+
  474. | *Getter* | is_highlight_all_occurrences_enabled() |
  475. +-----------+----------------------------------------+
  476. If ``true``, all occurrences of the selected text will be highlighted.
  477. ----
  478. .. _class_TextEdit_property_highlight_current_line:
  479. - :ref:`bool<class_bool>` **highlight_current_line**
  480. +-----------+-------------------------------------+
  481. | *Default* | ``false`` |
  482. +-----------+-------------------------------------+
  483. | *Setter* | set_highlight_current_line(value) |
  484. +-----------+-------------------------------------+
  485. | *Getter* | is_highlight_current_line_enabled() |
  486. +-----------+-------------------------------------+
  487. If ``true``, the line containing the cursor is highlighted.
  488. ----
  489. .. _class_TextEdit_property_minimap_draw:
  490. - :ref:`bool<class_bool>` **minimap_draw**
  491. +-----------+----------------------+
  492. | *Default* | ``false`` |
  493. +-----------+----------------------+
  494. | *Setter* | draw_minimap(value) |
  495. +-----------+----------------------+
  496. | *Getter* | is_drawing_minimap() |
  497. +-----------+----------------------+
  498. If ``true``, a minimap is shown, providing an outline of your source code.
  499. ----
  500. .. _class_TextEdit_property_minimap_width:
  501. - :ref:`int<class_int>` **minimap_width**
  502. +-----------+--------------------------+
  503. | *Default* | ``80`` |
  504. +-----------+--------------------------+
  505. | *Setter* | set_minimap_width(value) |
  506. +-----------+--------------------------+
  507. | *Getter* | get_minimap_width() |
  508. +-----------+--------------------------+
  509. The width, in pixels, of the minimap.
  510. ----
  511. .. _class_TextEdit_property_override_selected_font_color:
  512. - :ref:`bool<class_bool>` **override_selected_font_color**
  513. +-----------+-----------------------------------------+
  514. | *Default* | ``false`` |
  515. +-----------+-----------------------------------------+
  516. | *Setter* | set_override_selected_font_color(value) |
  517. +-----------+-----------------------------------------+
  518. | *Getter* | is_overriding_selected_font_color() |
  519. +-----------+-----------------------------------------+
  520. If ``true``, custom ``font_color_selected`` will be used for selected text.
  521. ----
  522. .. _class_TextEdit_property_readonly:
  523. - :ref:`bool<class_bool>` **readonly**
  524. +-----------+---------------------+
  525. | *Default* | ``false`` |
  526. +-----------+---------------------+
  527. | *Setter* | set_readonly(value) |
  528. +-----------+---------------------+
  529. | *Getter* | is_readonly() |
  530. +-----------+---------------------+
  531. If ``true``, read-only mode is enabled. Existing text cannot be modified and new text cannot be added.
  532. ----
  533. .. _class_TextEdit_property_scroll_horizontal:
  534. - :ref:`int<class_int>` **scroll_horizontal**
  535. +-----------+---------------------+
  536. | *Default* | ``0`` |
  537. +-----------+---------------------+
  538. | *Setter* | set_h_scroll(value) |
  539. +-----------+---------------------+
  540. | *Getter* | get_h_scroll() |
  541. +-----------+---------------------+
  542. If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels.
  543. ----
  544. .. _class_TextEdit_property_scroll_vertical:
  545. - :ref:`float<class_float>` **scroll_vertical**
  546. +-----------+---------------------+
  547. | *Default* | ``0.0`` |
  548. +-----------+---------------------+
  549. | *Setter* | set_v_scroll(value) |
  550. +-----------+---------------------+
  551. | *Getter* | get_v_scroll() |
  552. +-----------+---------------------+
  553. If there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line.
  554. ----
  555. .. _class_TextEdit_property_selecting_enabled:
  556. - :ref:`bool<class_bool>` **selecting_enabled**
  557. +-----------+------------------------------+
  558. | *Default* | ``true`` |
  559. +-----------+------------------------------+
  560. | *Setter* | set_selecting_enabled(value) |
  561. +-----------+------------------------------+
  562. | *Getter* | is_selecting_enabled() |
  563. +-----------+------------------------------+
  564. If ``true``, text can be selected.
  565. 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.
  566. ----
  567. .. _class_TextEdit_property_shortcut_keys_enabled:
  568. - :ref:`bool<class_bool>` **shortcut_keys_enabled**
  569. +-----------+----------------------------------+
  570. | *Default* | ``true`` |
  571. +-----------+----------------------------------+
  572. | *Setter* | set_shortcut_keys_enabled(value) |
  573. +-----------+----------------------------------+
  574. | *Getter* | is_shortcut_keys_enabled() |
  575. +-----------+----------------------------------+
  576. If ``true``, shortcut keys for context menu items are enabled, even if the context menu is disabled.
  577. ----
  578. .. _class_TextEdit_property_show_line_numbers:
  579. - :ref:`bool<class_bool>` **show_line_numbers**
  580. +-----------+--------------------------------+
  581. | *Default* | ``false`` |
  582. +-----------+--------------------------------+
  583. | *Setter* | set_show_line_numbers(value) |
  584. +-----------+--------------------------------+
  585. | *Getter* | is_show_line_numbers_enabled() |
  586. +-----------+--------------------------------+
  587. If ``true``, line numbers are displayed to the left of the text.
  588. ----
  589. .. _class_TextEdit_property_smooth_scrolling:
  590. - :ref:`bool<class_bool>` **smooth_scrolling**
  591. +-----------+---------------------------------+
  592. | *Default* | ``false`` |
  593. +-----------+---------------------------------+
  594. | *Setter* | set_smooth_scroll_enable(value) |
  595. +-----------+---------------------------------+
  596. | *Getter* | is_smooth_scroll_enabled() |
  597. +-----------+---------------------------------+
  598. If ``true``, sets the ``step`` of the scrollbars to ``0.25`` which results in smoother scrolling.
  599. ----
  600. .. _class_TextEdit_property_syntax_highlighting:
  601. - :ref:`bool<class_bool>` **syntax_highlighting**
  602. +-----------+------------------------------+
  603. | *Default* | ``false`` |
  604. +-----------+------------------------------+
  605. | *Setter* | set_syntax_coloring(value) |
  606. +-----------+------------------------------+
  607. | *Getter* | is_syntax_coloring_enabled() |
  608. +-----------+------------------------------+
  609. If ``true``, any custom color properties that have been set for this ``TextEdit`` will be visible.
  610. ----
  611. .. _class_TextEdit_property_text:
  612. - :ref:`String<class_String>` **text**
  613. +-----------+-----------------+
  614. | *Default* | ``""`` |
  615. +-----------+-----------------+
  616. | *Setter* | set_text(value) |
  617. +-----------+-----------------+
  618. | *Getter* | get_text() |
  619. +-----------+-----------------+
  620. String value of the ``TextEdit``.
  621. ----
  622. .. _class_TextEdit_property_v_scroll_speed:
  623. - :ref:`float<class_float>` **v_scroll_speed**
  624. +-----------+---------------------------+
  625. | *Default* | ``80.0`` |
  626. +-----------+---------------------------+
  627. | *Setter* | set_v_scroll_speed(value) |
  628. +-----------+---------------------------+
  629. | *Getter* | get_v_scroll_speed() |
  630. +-----------+---------------------------+
  631. Vertical scroll sensitivity.
  632. ----
  633. .. _class_TextEdit_property_virtual_keyboard_enabled:
  634. - :ref:`bool<class_bool>` **virtual_keyboard_enabled**
  635. +-----------+-------------------------------------+
  636. | *Default* | ``true`` |
  637. +-----------+-------------------------------------+
  638. | *Setter* | set_virtual_keyboard_enabled(value) |
  639. +-----------+-------------------------------------+
  640. | *Getter* | is_virtual_keyboard_enabled() |
  641. +-----------+-------------------------------------+
  642. If ``true``, the native virtual keyboard is shown when focused on platforms that support it.
  643. ----
  644. .. _class_TextEdit_property_wrap_enabled:
  645. - :ref:`bool<class_bool>` **wrap_enabled**
  646. +-----------+-------------------------+
  647. | *Default* | ``false`` |
  648. +-----------+-------------------------+
  649. | *Setter* | set_wrap_enabled(value) |
  650. +-----------+-------------------------+
  651. | *Getter* | is_wrap_enabled() |
  652. +-----------+-------------------------+
  653. If ``true``, enables text wrapping when it goes beyond the edge of what is visible.
  654. Method Descriptions
  655. -------------------
  656. .. _class_TextEdit_method_add_color_region:
  657. - void **add_color_region** **(** :ref:`String<class_String>` begin_key, :ref:`String<class_String>` end_key, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` line_only=false **)**
  658. Adds color region (given the delimiters) and its colors.
  659. ----
  660. .. _class_TextEdit_method_add_keyword_color:
  661. - void **add_keyword_color** **(** :ref:`String<class_String>` keyword, :ref:`Color<class_Color>` color **)**
  662. Adds a ``keyword`` and its :ref:`Color<class_Color>`.
  663. ----
  664. .. _class_TextEdit_method_can_fold:
  665. - :ref:`bool<class_bool>` **can_fold** **(** :ref:`int<class_int>` line **)** |const|
  666. Returns if the given line is foldable, that is, it has indented lines right below it.
  667. ----
  668. .. _class_TextEdit_method_center_viewport_to_cursor:
  669. - void **center_viewport_to_cursor** **(** **)**
  670. Centers the viewport on the line the editing cursor is at. This also resets the :ref:`scroll_horizontal<class_TextEdit_property_scroll_horizontal>` value to ``0``.
  671. ----
  672. .. _class_TextEdit_method_clear_colors:
  673. - void **clear_colors** **(** **)**
  674. Clears all custom syntax coloring information previously added with :ref:`add_color_region<class_TextEdit_method_add_color_region>` or :ref:`add_keyword_color<class_TextEdit_method_add_keyword_color>`.
  675. ----
  676. .. _class_TextEdit_method_clear_undo_history:
  677. - void **clear_undo_history** **(** **)**
  678. Clears the undo history.
  679. ----
  680. .. _class_TextEdit_method_copy:
  681. - void **copy** **(** **)**
  682. Copy's the current text selection.
  683. ----
  684. .. _class_TextEdit_method_cursor_get_column:
  685. - :ref:`int<class_int>` **cursor_get_column** **(** **)** |const|
  686. Returns the column the editing cursor is at.
  687. ----
  688. .. _class_TextEdit_method_cursor_get_line:
  689. - :ref:`int<class_int>` **cursor_get_line** **(** **)** |const|
  690. Returns the line the editing cursor is at.
  691. ----
  692. .. _class_TextEdit_method_cursor_set_column:
  693. - void **cursor_set_column** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)**
  694. Moves the cursor at the specified ``column`` index.
  695. If ``adjust_viewport`` is set to ``true``, the viewport will center at the cursor position after the move occurs.
  696. ----
  697. .. _class_TextEdit_method_cursor_set_line:
  698. - void **cursor_set_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 **)**
  699. Moves the cursor at the specified ``line`` index.
  700. If ``adjust_viewport`` is set to ``true``, the viewport will center at the cursor position after the move occurs.
  701. If ``can_be_hidden`` is set to ``true``, the specified ``line`` can be hidden using :ref:`set_line_as_hidden<class_TextEdit_method_set_line_as_hidden>`.
  702. ----
  703. .. _class_TextEdit_method_cut:
  704. - void **cut** **(** **)**
  705. Cut's the current selection.
  706. ----
  707. .. _class_TextEdit_method_deselect:
  708. - void **deselect** **(** **)**
  709. Deselects the current selection.
  710. ----
  711. .. _class_TextEdit_method_fold_all_lines:
  712. - void **fold_all_lines** **(** **)**
  713. Folds all lines that are possible to be folded (see :ref:`can_fold<class_TextEdit_method_can_fold>`).
  714. ----
  715. .. _class_TextEdit_method_fold_line:
  716. - void **fold_line** **(** :ref:`int<class_int>` line **)**
  717. Folds the given line, if possible (see :ref:`can_fold<class_TextEdit_method_can_fold>`).
  718. ----
  719. .. _class_TextEdit_method_get_breakpoints:
  720. - :ref:`Array<class_Array>` **get_breakpoints** **(** **)** |const|
  721. Returns an array containing the line number of each breakpoint.
  722. ----
  723. .. _class_TextEdit_method_get_keyword_color:
  724. - :ref:`Color<class_Color>` **get_keyword_color** **(** :ref:`String<class_String>` keyword **)** |const|
  725. Returns the :ref:`Color<class_Color>` of the specified ``keyword``.
  726. ----
  727. .. _class_TextEdit_method_get_line:
  728. - :ref:`String<class_String>` **get_line** **(** :ref:`int<class_int>` line **)** |const|
  729. Returns the text of a specific line.
  730. ----
  731. .. _class_TextEdit_method_get_line_column_at_pos:
  732. - :ref:`Vector2<class_Vector2>` **get_line_column_at_pos** **(** :ref:`Vector2<class_Vector2>` position **)** |const|
  733. Returns the line and column at the given position. In the returned vector, ``x`` is the column, ``y`` is the line.
  734. ----
  735. .. _class_TextEdit_method_get_line_count:
  736. - :ref:`int<class_int>` **get_line_count** **(** **)** |const|
  737. Returns the amount of total lines in the text.
  738. ----
  739. .. _class_TextEdit_method_get_line_height:
  740. - :ref:`int<class_int>` **get_line_height** **(** **)** |const|
  741. Returns the height of a largest line.
  742. ----
  743. .. _class_TextEdit_method_get_line_width:
  744. - :ref:`int<class_int>` **get_line_width** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=-1 **)** |const|
  745. Returns the width in pixels of the ``wrap_index`` on ``line``.
  746. ----
  747. .. _class_TextEdit_method_get_line_wrap_count:
  748. - :ref:`int<class_int>` **get_line_wrap_count** **(** :ref:`int<class_int>` line **)** |const|
  749. Returns the number of times the given line is wrapped.
  750. ----
  751. .. _class_TextEdit_method_get_line_wrapped_text:
  752. - :ref:`PoolStringArray<class_PoolStringArray>` **get_line_wrapped_text** **(** :ref:`int<class_int>` line **)** |const|
  753. Returns an array of :ref:`String<class_String>`\ s representing each wrapped index.
  754. ----
  755. .. _class_TextEdit_method_get_menu:
  756. - :ref:`PopupMenu<class_PopupMenu>` **get_menu** **(** **)** |const|
  757. Returns the :ref:`PopupMenu<class_PopupMenu>` of this ``TextEdit``. By default, this menu is displayed when right-clicking on the ``TextEdit``.
  758. **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:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
  759. ----
  760. .. _class_TextEdit_method_get_pos_at_line_column:
  761. - :ref:`Vector2<class_Vector2>` **get_pos_at_line_column** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
  762. 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.
  763. **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.
  764. ----
  765. .. _class_TextEdit_method_get_rect_at_line_column:
  766. - :ref:`Rect2<class_Rect2>` **get_rect_at_line_column** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
  767. 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.
  768. **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.
  769. ----
  770. .. _class_TextEdit_method_get_selection_from_column:
  771. - :ref:`int<class_int>` **get_selection_from_column** **(** **)** |const|
  772. Returns the selection begin column.
  773. ----
  774. .. _class_TextEdit_method_get_selection_from_line:
  775. - :ref:`int<class_int>` **get_selection_from_line** **(** **)** |const|
  776. Returns the selection begin line.
  777. ----
  778. .. _class_TextEdit_method_get_selection_text:
  779. - :ref:`String<class_String>` **get_selection_text** **(** **)** |const|
  780. Returns the text inside the selection.
  781. ----
  782. .. _class_TextEdit_method_get_selection_to_column:
  783. - :ref:`int<class_int>` **get_selection_to_column** **(** **)** |const|
  784. Returns the selection end column.
  785. ----
  786. .. _class_TextEdit_method_get_selection_to_line:
  787. - :ref:`int<class_int>` **get_selection_to_line** **(** **)** |const|
  788. Returns the selection end line.
  789. ----
  790. .. _class_TextEdit_method_get_total_gutter_width:
  791. - :ref:`int<class_int>` **get_total_gutter_width** **(** **)** |const|
  792. Returns the total width of all gutters and internal padding.
  793. ----
  794. .. _class_TextEdit_method_get_word_under_cursor:
  795. - :ref:`String<class_String>` **get_word_under_cursor** **(** **)** |const|
  796. Returns a :ref:`String<class_String>` text with the word under the caret (text cursor) location.
  797. ----
  798. .. _class_TextEdit_method_has_keyword_color:
  799. - :ref:`bool<class_bool>` **has_keyword_color** **(** :ref:`String<class_String>` keyword **)** |const|
  800. Returns whether the specified ``keyword`` has a color set to it or not.
  801. ----
  802. .. _class_TextEdit_method_has_redo:
  803. - :ref:`bool<class_bool>` **has_redo** **(** **)** |const|
  804. Returns ``true`` if a "redo" action is available.
  805. ----
  806. .. _class_TextEdit_method_has_undo:
  807. - :ref:`bool<class_bool>` **has_undo** **(** **)** |const|
  808. Returns ``true`` if an "undo" action is available.
  809. ----
  810. .. _class_TextEdit_method_insert_text_at_cursor:
  811. - void **insert_text_at_cursor** **(** :ref:`String<class_String>` text **)**
  812. Insert the specified text at the cursor position.
  813. ----
  814. .. _class_TextEdit_method_is_folded:
  815. - :ref:`bool<class_bool>` **is_folded** **(** :ref:`int<class_int>` line **)** |const|
  816. Returns whether the line at the specified index is folded or not.
  817. ----
  818. .. _class_TextEdit_method_is_line_hidden:
  819. - :ref:`bool<class_bool>` **is_line_hidden** **(** :ref:`int<class_int>` line **)** |const|
  820. Returns whether the line at the specified index is hidden or not.
  821. ----
  822. .. _class_TextEdit_method_is_line_set_as_bookmark:
  823. - :ref:`bool<class_bool>` **is_line_set_as_bookmark** **(** :ref:`int<class_int>` line **)** |const|
  824. Returns ``true`` when the specified ``line`` is bookmarked.
  825. ----
  826. .. _class_TextEdit_method_is_line_set_as_breakpoint:
  827. - :ref:`bool<class_bool>` **is_line_set_as_breakpoint** **(** :ref:`int<class_int>` line **)** |const|
  828. Returns ``true`` when the specified ``line`` has a breakpoint.
  829. ----
  830. .. _class_TextEdit_method_is_line_set_as_safe:
  831. - :ref:`bool<class_bool>` **is_line_set_as_safe** **(** :ref:`int<class_int>` line **)** |const|
  832. Returns ``true`` when the specified ``line`` is marked as safe.
  833. ----
  834. .. _class_TextEdit_method_is_line_wrapped:
  835. - :ref:`bool<class_bool>` **is_line_wrapped** **(** :ref:`int<class_int>` line **)** |const|
  836. Returns if the given line is wrapped.
  837. ----
  838. .. _class_TextEdit_method_is_selection_active:
  839. - :ref:`bool<class_bool>` **is_selection_active** **(** **)** |const|
  840. Returns ``true`` if the selection is active.
  841. ----
  842. .. _class_TextEdit_method_menu_option:
  843. - void **menu_option** **(** :ref:`int<class_int>` option **)**
  844. Triggers a right-click menu action by the specified index. See :ref:`MenuItems<enum_TextEdit_MenuItems>` for a list of available indexes.
  845. ----
  846. .. _class_TextEdit_method_paste:
  847. - void **paste** **(** **)**
  848. Paste the current selection.
  849. ----
  850. .. _class_TextEdit_method_redo:
  851. - void **redo** **(** **)**
  852. Perform redo operation.
  853. ----
  854. .. _class_TextEdit_method_remove_breakpoints:
  855. - void **remove_breakpoints** **(** **)**
  856. Removes all the breakpoints. This will not fire the :ref:`breakpoint_toggled<class_TextEdit_signal_breakpoint_toggled>` signal.
  857. ----
  858. .. _class_TextEdit_method_search:
  859. - :ref:`PoolIntArray<class_PoolIntArray>` **search** **(** :ref:`String<class_String>` key, :ref:`int<class_int>` flags, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column **)** |const|
  860. Perform a search inside the text. Search flags can be specified in the :ref:`SearchFlags<enum_TextEdit_SearchFlags>` enum.
  861. Returns an empty ``PoolIntArray`` if no result was found. Otherwise, the result line and column can be accessed at indices specified in the :ref:`SearchResult<enum_TextEdit_SearchResult>` enum, e.g:
  862. ::
  863. var result = search(key, flags, line, column)
  864. if result.size() > 0:
  865. # Result found.
  866. var res_line = result[TextEdit.SEARCH_RESULT_LINE]
  867. var res_column = result[TextEdit.SEARCH_RESULT_COLUMN]
  868. ----
  869. .. _class_TextEdit_method_select:
  870. - 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 **)**
  871. Perform selection, from line/column to line/column.
  872. If :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` is ``false``, no selection will occur.
  873. ----
  874. .. _class_TextEdit_method_select_all:
  875. - void **select_all** **(** **)**
  876. Select all the text.
  877. If :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` is ``false``, no selection will occur.
  878. ----
  879. .. _class_TextEdit_method_set_line:
  880. - void **set_line** **(** :ref:`int<class_int>` line, :ref:`String<class_String>` new_text **)**
  881. Sets the text for a specific line.
  882. ----
  883. .. _class_TextEdit_method_set_line_as_bookmark:
  884. - void **set_line_as_bookmark** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` bookmark **)**
  885. Bookmarks the ``line`` if ``bookmark`` is true. Deletes the bookmark if ``bookmark`` is false.
  886. Bookmarks are shown in the :ref:`breakpoint_gutter<class_TextEdit_property_breakpoint_gutter>`.
  887. ----
  888. .. _class_TextEdit_method_set_line_as_breakpoint:
  889. - void **set_line_as_breakpoint** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` breakpoint **)**
  890. Adds or removes the breakpoint in ``line``. Breakpoints are shown in the :ref:`breakpoint_gutter<class_TextEdit_property_breakpoint_gutter>`.
  891. ----
  892. .. _class_TextEdit_method_set_line_as_hidden:
  893. - void **set_line_as_hidden** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` enable **)**
  894. If ``true``, hides the line of the specified index.
  895. ----
  896. .. _class_TextEdit_method_set_line_as_safe:
  897. - void **set_line_as_safe** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` safe **)**
  898. If ``true``, marks the ``line`` as safe.
  899. This will show the line number with the color provided in the ``safe_line_number_color`` theme property.
  900. ----
  901. .. _class_TextEdit_method_toggle_fold_line:
  902. - void **toggle_fold_line** **(** :ref:`int<class_int>` line **)**
  903. Toggle the folding of the code block at the given line.
  904. ----
  905. .. _class_TextEdit_method_undo:
  906. - void **undo** **(** **)**
  907. Perform undo operation.
  908. ----
  909. .. _class_TextEdit_method_unfold_line:
  910. - void **unfold_line** **(** :ref:`int<class_int>` line **)**
  911. Unfolds the given line, if folded.
  912. ----
  913. .. _class_TextEdit_method_unhide_all_lines:
  914. - void **unhide_all_lines** **(** **)**
  915. Unhide all lines that were previously set to hidden by :ref:`set_line_as_hidden<class_TextEdit_method_set_line_as_hidden>`.
  916. Theme Property Descriptions
  917. ---------------------------
  918. .. _class_TextEdit_theme_color_background_color:
  919. - :ref:`Color<class_Color>` **background_color**
  920. +-----------+-------------------------+
  921. | *Default* | ``Color( 0, 0, 0, 0 )`` |
  922. +-----------+-------------------------+
  923. Sets the background :ref:`Color<class_Color>` of this ``TextEdit``. :ref:`syntax_highlighting<class_TextEdit_property_syntax_highlighting>` has to be enabled.
  924. ----
  925. .. _class_TextEdit_theme_color_bookmark_color:
  926. - :ref:`Color<class_Color>` **bookmark_color**
  927. +-----------+----------------------------------+
  928. | *Default* | ``Color( 0.08, 0.49, 0.98, 1 )`` |
  929. +-----------+----------------------------------+
  930. Sets the :ref:`Color<class_Color>` of the bookmark marker. :ref:`syntax_highlighting<class_TextEdit_property_syntax_highlighting>` has to be enabled.
  931. ----
  932. .. _class_TextEdit_theme_color_brace_mismatch_color:
  933. - :ref:`Color<class_Color>` **brace_mismatch_color**
  934. +-----------+-----------------------------+
  935. | *Default* | ``Color( 1, 0.2, 0.2, 1 )`` |
  936. +-----------+-----------------------------+
  937. ----
  938. .. _class_TextEdit_theme_color_breakpoint_color:
  939. - :ref:`Color<class_Color>` **breakpoint_color**
  940. +-----------+---------------------------------+
  941. | *Default* | ``Color( 0.8, 0.8, 0.4, 0.2 )`` |
  942. +-----------+---------------------------------+
  943. Sets the :ref:`Color<class_Color>` of the breakpoints. :ref:`breakpoint_gutter<class_TextEdit_property_breakpoint_gutter>` has to be enabled.
  944. ----
  945. .. _class_TextEdit_theme_color_caret_background_color:
  946. - :ref:`Color<class_Color>` **caret_background_color**
  947. +-----------+-------------------------+
  948. | *Default* | ``Color( 0, 0, 0, 1 )`` |
  949. +-----------+-------------------------+
  950. ----
  951. .. _class_TextEdit_theme_color_caret_color:
  952. - :ref:`Color<class_Color>` **caret_color**
  953. +-----------+----------------------------------+
  954. | *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` |
  955. +-----------+----------------------------------+
  956. ----
  957. .. _class_TextEdit_theme_color_code_folding_color:
  958. - :ref:`Color<class_Color>` **code_folding_color**
  959. +-----------+---------------------------------+
  960. | *Default* | ``Color( 0.8, 0.8, 0.8, 0.8 )`` |
  961. +-----------+---------------------------------+
  962. ----
  963. .. _class_TextEdit_theme_color_completion_background_color:
  964. - :ref:`Color<class_Color>` **completion_background_color**
  965. +-----------+---------------------------------+
  966. | *Default* | ``Color( 0.17, 0.16, 0.2, 1 )`` |
  967. +-----------+---------------------------------+
  968. ----
  969. .. _class_TextEdit_theme_color_completion_existing_color:
  970. - :ref:`Color<class_Color>` **completion_existing_color**
  971. +-----------+-------------------------------------+
  972. | *Default* | ``Color( 0.87, 0.87, 0.87, 0.13 )`` |
  973. +-----------+-------------------------------------+
  974. ----
  975. .. _class_TextEdit_theme_color_completion_font_color:
  976. - :ref:`Color<class_Color>` **completion_font_color**
  977. +-----------+----------------------------------+
  978. | *Default* | ``Color( 0.67, 0.67, 0.67, 1 )`` |
  979. +-----------+----------------------------------+
  980. ----
  981. .. _class_TextEdit_theme_color_completion_scroll_color:
  982. - :ref:`Color<class_Color>` **completion_scroll_color**
  983. +-----------+-------------------------+
  984. | *Default* | ``Color( 1, 1, 1, 1 )`` |
  985. +-----------+-------------------------+
  986. ----
  987. .. _class_TextEdit_theme_color_completion_selected_color:
  988. - :ref:`Color<class_Color>` **completion_selected_color**
  989. +-----------+----------------------------------+
  990. | *Default* | ``Color( 0.26, 0.26, 0.27, 1 )`` |
  991. +-----------+----------------------------------+
  992. ----
  993. .. _class_TextEdit_theme_color_current_line_color:
  994. - :ref:`Color<class_Color>` **current_line_color**
  995. +-----------+------------------------------------+
  996. | *Default* | ``Color( 0.25, 0.25, 0.26, 0.8 )`` |
  997. +-----------+------------------------------------+
  998. Sets the :ref:`Color<class_Color>` of the breakpoints. :ref:`breakpoint_gutter<class_TextEdit_property_breakpoint_gutter>` has to be enabled.
  999. ----
  1000. .. _class_TextEdit_theme_color_executing_line_color:
  1001. - :ref:`Color<class_Color>` **executing_line_color**
  1002. +-----------+---------------------------------+
  1003. | *Default* | ``Color( 0.2, 0.8, 0.2, 0.4 )`` |
  1004. +-----------+---------------------------------+
  1005. ----
  1006. .. _class_TextEdit_theme_color_font_color:
  1007. - :ref:`Color<class_Color>` **font_color**
  1008. +-----------+----------------------------------+
  1009. | *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` |
  1010. +-----------+----------------------------------+
  1011. Sets the font :ref:`Color<class_Color>`.
  1012. ----
  1013. .. _class_TextEdit_theme_color_font_color_readonly:
  1014. - :ref:`Color<class_Color>` **font_color_readonly**
  1015. +-----------+------------------------------------+
  1016. | *Default* | ``Color( 0.88, 0.88, 0.88, 0.5 )`` |
  1017. +-----------+------------------------------------+
  1018. ----
  1019. .. _class_TextEdit_theme_color_font_color_selected:
  1020. - :ref:`Color<class_Color>` **font_color_selected**
  1021. +-----------+-------------------------+
  1022. | *Default* | ``Color( 0, 0, 0, 1 )`` |
  1023. +-----------+-------------------------+
  1024. 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.
  1025. ----
  1026. .. _class_TextEdit_theme_color_function_color:
  1027. - :ref:`Color<class_Color>` **function_color**
  1028. +-----------+---------------------------------+
  1029. | *Default* | ``Color( 0.4, 0.64, 0.81, 1 )`` |
  1030. +-----------+---------------------------------+
  1031. ----
  1032. .. _class_TextEdit_theme_color_line_number_color:
  1033. - :ref:`Color<class_Color>` **line_number_color**
  1034. +-----------+------------------------------------+
  1035. | *Default* | ``Color( 0.67, 0.67, 0.67, 0.4 )`` |
  1036. +-----------+------------------------------------+
  1037. Sets the :ref:`Color<class_Color>` of the line numbers. :ref:`show_line_numbers<class_TextEdit_property_show_line_numbers>` has to be enabled.
  1038. ----
  1039. .. _class_TextEdit_theme_color_mark_color:
  1040. - :ref:`Color<class_Color>` **mark_color**
  1041. +-----------+-------------------------------+
  1042. | *Default* | ``Color( 1, 0.4, 0.4, 0.4 )`` |
  1043. +-----------+-------------------------------+
  1044. Sets the :ref:`Color<class_Color>` of marked text.
  1045. ----
  1046. .. _class_TextEdit_theme_color_member_variable_color:
  1047. - :ref:`Color<class_Color>` **member_variable_color**
  1048. +-----------+---------------------------------+
  1049. | *Default* | ``Color( 0.9, 0.31, 0.35, 1 )`` |
  1050. +-----------+---------------------------------+
  1051. ----
  1052. .. _class_TextEdit_theme_color_number_color:
  1053. - :ref:`Color<class_Color>` **number_color**
  1054. +-----------+---------------------------------+
  1055. | *Default* | ``Color( 0.92, 0.58, 0.2, 1 )`` |
  1056. +-----------+---------------------------------+
  1057. ----
  1058. .. _class_TextEdit_theme_color_safe_line_number_color:
  1059. - :ref:`Color<class_Color>` **safe_line_number_color**
  1060. +-----------+------------------------------------+
  1061. | *Default* | ``Color( 0.67, 0.78, 0.67, 0.6 )`` |
  1062. +-----------+------------------------------------+
  1063. ----
  1064. .. _class_TextEdit_theme_color_selection_color:
  1065. - :ref:`Color<class_Color>` **selection_color**
  1066. +-----------+----------------------------------+
  1067. | *Default* | ``Color( 0.49, 0.49, 0.49, 1 )`` |
  1068. +-----------+----------------------------------+
  1069. Sets the highlight :ref:`Color<class_Color>` of text selections.
  1070. ----
  1071. .. _class_TextEdit_theme_color_symbol_color:
  1072. - :ref:`Color<class_Color>` **symbol_color**
  1073. +-----------+----------------------------------+
  1074. | *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  1075. +-----------+----------------------------------+
  1076. ----
  1077. .. _class_TextEdit_theme_color_word_highlighted_color:
  1078. - :ref:`Color<class_Color>` **word_highlighted_color**
  1079. +-----------+----------------------------------+
  1080. | *Default* | ``Color( 0.8, 0.9, 0.9, 0.15 )`` |
  1081. +-----------+----------------------------------+
  1082. Sets the highlight :ref:`Color<class_Color>` of multiple occurrences. :ref:`highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` has to be enabled.
  1083. ----
  1084. .. _class_TextEdit_theme_constant_completion_lines:
  1085. - :ref:`int<class_int>` **completion_lines**
  1086. +-----------+-------+
  1087. | *Default* | ``7`` |
  1088. +-----------+-------+
  1089. ----
  1090. .. _class_TextEdit_theme_constant_completion_max_width:
  1091. - :ref:`int<class_int>` **completion_max_width**
  1092. +-----------+--------+
  1093. | *Default* | ``50`` |
  1094. +-----------+--------+
  1095. ----
  1096. .. _class_TextEdit_theme_constant_completion_scroll_width:
  1097. - :ref:`int<class_int>` **completion_scroll_width**
  1098. +-----------+-------+
  1099. | *Default* | ``3`` |
  1100. +-----------+-------+
  1101. ----
  1102. .. _class_TextEdit_theme_constant_line_spacing:
  1103. - :ref:`int<class_int>` **line_spacing**
  1104. +-----------+-------+
  1105. | *Default* | ``4`` |
  1106. +-----------+-------+
  1107. Sets the spacing between the lines.
  1108. ----
  1109. .. _class_TextEdit_theme_font_font:
  1110. - :ref:`Font<class_Font>` **font**
  1111. Sets the default :ref:`Font<class_Font>`.
  1112. ----
  1113. .. _class_TextEdit_theme_icon_fold:
  1114. - :ref:`Texture<class_Texture>` **fold**
  1115. ----
  1116. .. _class_TextEdit_theme_icon_folded:
  1117. - :ref:`Texture<class_Texture>` **folded**
  1118. ----
  1119. .. _class_TextEdit_theme_icon_space:
  1120. - :ref:`Texture<class_Texture>` **space**
  1121. ----
  1122. .. _class_TextEdit_theme_icon_tab:
  1123. - :ref:`Texture<class_Texture>` **tab**
  1124. Sets a custom :ref:`Texture<class_Texture>` for tab text characters.
  1125. ----
  1126. .. _class_TextEdit_theme_style_completion:
  1127. - :ref:`StyleBox<class_StyleBox>` **completion**
  1128. ----
  1129. .. _class_TextEdit_theme_style_focus:
  1130. - :ref:`StyleBox<class_StyleBox>` **focus**
  1131. ----
  1132. .. _class_TextEdit_theme_style_normal:
  1133. - :ref:`StyleBox<class_StyleBox>` **normal**
  1134. Sets the :ref:`StyleBox<class_StyleBox>` of this ``TextEdit``.
  1135. ----
  1136. .. _class_TextEdit_theme_style_read_only:
  1137. - :ref:`StyleBox<class_StyleBox>` **read_only**
  1138. Sets the :ref:`StyleBox<class_StyleBox>` of this ``TextEdit`` when :ref:`readonly<class_TextEdit_property_readonly>` is enabled.
  1139. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1140. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1141. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`