class_textedit.rst 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.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. Properties
  14. ----------
  15. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  16. | :ref:`bool<class_bool>` | :ref:`breakpoint_gutter<class_TextEdit_property_breakpoint_gutter>` | ``false`` |
  17. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  18. | :ref:`bool<class_bool>` | :ref:`caret_blink<class_TextEdit_property_caret_blink>` | ``false`` |
  19. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  20. | :ref:`float<class_float>` | :ref:`caret_blink_speed<class_TextEdit_property_caret_blink_speed>` | ``0.65`` |
  21. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  22. | :ref:`bool<class_bool>` | :ref:`caret_block_mode<class_TextEdit_property_caret_block_mode>` | ``false`` |
  23. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  24. | :ref:`bool<class_bool>` | :ref:`caret_moving_by_right_click<class_TextEdit_property_caret_moving_by_right_click>` | ``true`` |
  25. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  26. | :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_TextEdit_property_context_menu_enabled>` | ``true`` |
  27. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  28. | :ref:`bool<class_bool>` | :ref:`draw_spaces<class_TextEdit_property_draw_spaces>` | ``false`` |
  29. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  30. | :ref:`bool<class_bool>` | :ref:`draw_tabs<class_TextEdit_property_draw_tabs>` | ``false`` |
  31. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  32. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | **O:** ``2`` |
  33. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  34. | :ref:`bool<class_bool>` | :ref:`fold_gutter<class_TextEdit_property_fold_gutter>` | ``false`` |
  35. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  36. | :ref:`bool<class_bool>` | :ref:`hiding_enabled<class_TextEdit_property_hiding_enabled>` | ``false`` |
  37. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  38. | :ref:`bool<class_bool>` | :ref:`highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` | ``false`` |
  39. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  40. | :ref:`bool<class_bool>` | :ref:`highlight_current_line<class_TextEdit_property_highlight_current_line>` | ``false`` |
  41. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  42. | :ref:`bool<class_bool>` | :ref:`minimap_draw<class_TextEdit_property_minimap_draw>` | ``false`` |
  43. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  44. | :ref:`int<class_int>` | :ref:`minimap_width<class_TextEdit_property_minimap_width>` | ``80`` |
  45. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  46. | :ref:`CursorShape<enum_Control_CursorShape>` | mouse_default_cursor_shape | **O:** ``1`` |
  47. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  48. | :ref:`bool<class_bool>` | :ref:`override_selected_font_color<class_TextEdit_property_override_selected_font_color>` | ``false`` |
  49. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  50. | :ref:`bool<class_bool>` | :ref:`readonly<class_TextEdit_property_readonly>` | ``false`` |
  51. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  52. | :ref:`int<class_int>` | :ref:`scroll_horizontal<class_TextEdit_property_scroll_horizontal>` | ``0`` |
  53. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  54. | :ref:`float<class_float>` | :ref:`scroll_vertical<class_TextEdit_property_scroll_vertical>` | ``0.0`` |
  55. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  56. | :ref:`bool<class_bool>` | :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` | ``true`` |
  57. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  58. | :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_TextEdit_property_shortcut_keys_enabled>` | ``true`` |
  59. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  60. | :ref:`bool<class_bool>` | :ref:`show_line_numbers<class_TextEdit_property_show_line_numbers>` | ``false`` |
  61. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  62. | :ref:`bool<class_bool>` | :ref:`smooth_scrolling<class_TextEdit_property_smooth_scrolling>` | ``false`` |
  63. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  64. | :ref:`bool<class_bool>` | :ref:`syntax_highlighting<class_TextEdit_property_syntax_highlighting>` | ``false`` |
  65. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  66. | :ref:`String<class_String>` | :ref:`text<class_TextEdit_property_text>` | ``""`` |
  67. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  68. | :ref:`float<class_float>` | :ref:`v_scroll_speed<class_TextEdit_property_v_scroll_speed>` | ``80.0`` |
  69. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  70. | :ref:`bool<class_bool>` | :ref:`wrap_enabled<class_TextEdit_property_wrap_enabled>` | ``false`` |
  71. +----------------------------------------------+-------------------------------------------------------------------------------------------+--------------+
  72. Methods
  73. -------
  74. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | 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 **)** |
  76. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`add_keyword_color<class_TextEdit_method_add_keyword_color>` **(** :ref:`String<class_String>` keyword, :ref:`Color<class_Color>` color **)** |
  78. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`bool<class_bool>` | :ref:`can_fold<class_TextEdit_method_can_fold>` **(** :ref:`int<class_int>` line **)** const |
  80. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`center_viewport_to_cursor<class_TextEdit_method_center_viewport_to_cursor>` **(** **)** |
  82. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`clear_colors<class_TextEdit_method_clear_colors>` **(** **)** |
  84. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`clear_undo_history<class_TextEdit_method_clear_undo_history>` **(** **)** |
  86. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`copy<class_TextEdit_method_copy>` **(** **)** |
  88. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`int<class_int>` | :ref:`cursor_get_column<class_TextEdit_method_cursor_get_column>` **(** **)** const |
  90. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`int<class_int>` | :ref:`cursor_get_line<class_TextEdit_method_cursor_get_line>` **(** **)** const |
  92. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`cursor_set_column<class_TextEdit_method_cursor_set_column>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)** |
  94. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | 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 **)** |
  96. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`cut<class_TextEdit_method_cut>` **(** **)** |
  98. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`deselect<class_TextEdit_method_deselect>` **(** **)** |
  100. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`fold_all_lines<class_TextEdit_method_fold_all_lines>` **(** **)** |
  102. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`fold_line<class_TextEdit_method_fold_line>` **(** :ref:`int<class_int>` line **)** |
  104. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`Array<class_Array>` | :ref:`get_breakpoints<class_TextEdit_method_get_breakpoints>` **(** **)** const |
  106. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`Color<class_Color>` | :ref:`get_keyword_color<class_TextEdit_method_get_keyword_color>` **(** :ref:`String<class_String>` keyword **)** const |
  108. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`String<class_String>` | :ref:`get_line<class_TextEdit_method_get_line>` **(** :ref:`int<class_int>` line **)** const |
  110. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`int<class_int>` | :ref:`get_line_count<class_TextEdit_method_get_line_count>` **(** **)** const |
  112. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_TextEdit_method_get_menu>` **(** **)** const |
  114. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`int<class_int>` | :ref:`get_selection_from_column<class_TextEdit_method_get_selection_from_column>` **(** **)** const |
  116. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`int<class_int>` | :ref:`get_selection_from_line<class_TextEdit_method_get_selection_from_line>` **(** **)** const |
  118. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`String<class_String>` | :ref:`get_selection_text<class_TextEdit_method_get_selection_text>` **(** **)** const |
  120. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`int<class_int>` | :ref:`get_selection_to_column<class_TextEdit_method_get_selection_to_column>` **(** **)** const |
  122. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`int<class_int>` | :ref:`get_selection_to_line<class_TextEdit_method_get_selection_to_line>` **(** **)** const |
  124. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`String<class_String>` | :ref:`get_word_under_cursor<class_TextEdit_method_get_word_under_cursor>` **(** **)** const |
  126. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`bool<class_bool>` | :ref:`has_keyword_color<class_TextEdit_method_has_keyword_color>` **(** :ref:`String<class_String>` keyword **)** const |
  128. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | void | :ref:`insert_text_at_cursor<class_TextEdit_method_insert_text_at_cursor>` **(** :ref:`String<class_String>` text **)** |
  130. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`bool<class_bool>` | :ref:`is_folded<class_TextEdit_method_is_folded>` **(** :ref:`int<class_int>` line **)** const |
  132. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`bool<class_bool>` | :ref:`is_line_hidden<class_TextEdit_method_is_line_hidden>` **(** :ref:`int<class_int>` line **)** const |
  134. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`bool<class_bool>` | :ref:`is_selection_active<class_TextEdit_method_is_selection_active>` **(** **)** const |
  136. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`menu_option<class_TextEdit_method_menu_option>` **(** :ref:`int<class_int>` option **)** |
  138. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`paste<class_TextEdit_method_paste>` **(** **)** |
  140. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | void | :ref:`redo<class_TextEdit_method_redo>` **(** **)** |
  142. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | void | :ref:`remove_breakpoints<class_TextEdit_method_remove_breakpoints>` **(** **)** |
  144. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :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 |
  146. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | 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 **)** |
  148. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | void | :ref:`select_all<class_TextEdit_method_select_all>` **(** **)** |
  150. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | void | :ref:`set_line_as_hidden<class_TextEdit_method_set_line_as_hidden>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` enable **)** |
  152. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | void | :ref:`toggle_fold_line<class_TextEdit_method_toggle_fold_line>` **(** :ref:`int<class_int>` line **)** |
  154. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | void | :ref:`undo<class_TextEdit_method_undo>` **(** **)** |
  156. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | void | :ref:`unfold_line<class_TextEdit_method_unfold_line>` **(** :ref:`int<class_int>` line **)** |
  158. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | void | :ref:`unhide_all_lines<class_TextEdit_method_unhide_all_lines>` **(** **)** |
  160. +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. Theme Properties
  162. ----------------
  163. +-----------------------------------+-----------------------------+---------------------------------+
  164. | :ref:`Color<class_Color>` | background_color | Color( 0, 0, 0, 0 ) |
  165. +-----------------------------------+-----------------------------+---------------------------------+
  166. | :ref:`Color<class_Color>` | bookmark_color | Color( 0.08, 0.49, 0.98, 1 ) |
  167. +-----------------------------------+-----------------------------+---------------------------------+
  168. | :ref:`Color<class_Color>` | brace_mismatch_color | Color( 1, 0.2, 0.2, 1 ) |
  169. +-----------------------------------+-----------------------------+---------------------------------+
  170. | :ref:`Color<class_Color>` | breakpoint_color | Color( 0.8, 0.8, 0.4, 0.2 ) |
  171. +-----------------------------------+-----------------------------+---------------------------------+
  172. | :ref:`Color<class_Color>` | caret_background_color | Color( 0, 0, 0, 1 ) |
  173. +-----------------------------------+-----------------------------+---------------------------------+
  174. | :ref:`Color<class_Color>` | caret_color | Color( 0.88, 0.88, 0.88, 1 ) |
  175. +-----------------------------------+-----------------------------+---------------------------------+
  176. | :ref:`Color<class_Color>` | code_folding_color | Color( 0.8, 0.8, 0.8, 0.8 ) |
  177. +-----------------------------------+-----------------------------+---------------------------------+
  178. | :ref:`StyleBox<class_StyleBox>` | completion | |
  179. +-----------------------------------+-----------------------------+---------------------------------+
  180. | :ref:`Color<class_Color>` | completion_background_color | Color( 0.17, 0.16, 0.2, 1 ) |
  181. +-----------------------------------+-----------------------------+---------------------------------+
  182. | :ref:`Color<class_Color>` | completion_existing_color | Color( 0.87, 0.87, 0.87, 0.13 ) |
  183. +-----------------------------------+-----------------------------+---------------------------------+
  184. | :ref:`Color<class_Color>` | completion_font_color | Color( 0.67, 0.67, 0.67, 1 ) |
  185. +-----------------------------------+-----------------------------+---------------------------------+
  186. | :ref:`int<class_int>` | completion_lines | 7 |
  187. +-----------------------------------+-----------------------------+---------------------------------+
  188. | :ref:`int<class_int>` | completion_max_width | 50 |
  189. +-----------------------------------+-----------------------------+---------------------------------+
  190. | :ref:`Color<class_Color>` | completion_scroll_color | Color( 1, 1, 1, 1 ) |
  191. +-----------------------------------+-----------------------------+---------------------------------+
  192. | :ref:`int<class_int>` | completion_scroll_width | 3 |
  193. +-----------------------------------+-----------------------------+---------------------------------+
  194. | :ref:`Color<class_Color>` | completion_selected_color | Color( 0.26, 0.26, 0.27, 1 ) |
  195. +-----------------------------------+-----------------------------+---------------------------------+
  196. | :ref:`Color<class_Color>` | current_line_color | Color( 0.25, 0.25, 0.26, 0.8 ) |
  197. +-----------------------------------+-----------------------------+---------------------------------+
  198. | :ref:`Color<class_Color>` | executing_line_color | Color( 0.2, 0.8, 0.2, 0.4 ) |
  199. +-----------------------------------+-----------------------------+---------------------------------+
  200. | :ref:`StyleBox<class_StyleBox>` | focus | |
  201. +-----------------------------------+-----------------------------+---------------------------------+
  202. | :ref:`Texture2D<class_Texture2D>` | fold | |
  203. +-----------------------------------+-----------------------------+---------------------------------+
  204. | :ref:`Texture2D<class_Texture2D>` | folded | |
  205. +-----------------------------------+-----------------------------+---------------------------------+
  206. | :ref:`Font<class_Font>` | font | |
  207. +-----------------------------------+-----------------------------+---------------------------------+
  208. | :ref:`Color<class_Color>` | font_color | Color( 0.88, 0.88, 0.88, 1 ) |
  209. +-----------------------------------+-----------------------------+---------------------------------+
  210. | :ref:`Color<class_Color>` | font_color_readonly | Color( 0.88, 0.88, 0.88, 0.5 ) |
  211. +-----------------------------------+-----------------------------+---------------------------------+
  212. | :ref:`Color<class_Color>` | font_color_selected | Color( 0, 0, 0, 1 ) |
  213. +-----------------------------------+-----------------------------+---------------------------------+
  214. | :ref:`Color<class_Color>` | function_color | Color( 0.4, 0.64, 0.81, 1 ) |
  215. +-----------------------------------+-----------------------------+---------------------------------+
  216. | :ref:`Color<class_Color>` | line_number_color | Color( 0.67, 0.67, 0.67, 0.4 ) |
  217. +-----------------------------------+-----------------------------+---------------------------------+
  218. | :ref:`int<class_int>` | line_spacing | 4 |
  219. +-----------------------------------+-----------------------------+---------------------------------+
  220. | :ref:`Color<class_Color>` | mark_color | Color( 1, 0.4, 0.4, 0.4 ) |
  221. +-----------------------------------+-----------------------------+---------------------------------+
  222. | :ref:`Color<class_Color>` | member_variable_color | Color( 0.9, 0.31, 0.35, 1 ) |
  223. +-----------------------------------+-----------------------------+---------------------------------+
  224. | :ref:`StyleBox<class_StyleBox>` | normal | |
  225. +-----------------------------------+-----------------------------+---------------------------------+
  226. | :ref:`Color<class_Color>` | number_color | Color( 0.92, 0.58, 0.2, 1 ) |
  227. +-----------------------------------+-----------------------------+---------------------------------+
  228. | :ref:`StyleBox<class_StyleBox>` | read_only | |
  229. +-----------------------------------+-----------------------------+---------------------------------+
  230. | :ref:`Color<class_Color>` | safe_line_number_color | Color( 0.67, 0.78, 0.67, 0.6 ) |
  231. +-----------------------------------+-----------------------------+---------------------------------+
  232. | :ref:`Color<class_Color>` | selection_color | Color( 0.49, 0.49, 0.49, 1 ) |
  233. +-----------------------------------+-----------------------------+---------------------------------+
  234. | :ref:`Texture2D<class_Texture2D>` | space | |
  235. +-----------------------------------+-----------------------------+---------------------------------+
  236. | :ref:`Color<class_Color>` | symbol_color | Color( 0.94, 0.94, 0.94, 1 ) |
  237. +-----------------------------------+-----------------------------+---------------------------------+
  238. | :ref:`Texture2D<class_Texture2D>` | tab | |
  239. +-----------------------------------+-----------------------------+---------------------------------+
  240. | :ref:`Color<class_Color>` | word_highlighted_color | Color( 0.8, 0.9, 0.9, 0.15 ) |
  241. +-----------------------------------+-----------------------------+---------------------------------+
  242. Signals
  243. -------
  244. .. _class_TextEdit_signal_breakpoint_toggled:
  245. - **breakpoint_toggled** **(** :ref:`int<class_int>` row **)**
  246. Emitted when a breakpoint is placed via the breakpoint gutter.
  247. ----
  248. .. _class_TextEdit_signal_cursor_changed:
  249. - **cursor_changed** **(** **)**
  250. Emitted when the cursor changes.
  251. ----
  252. .. _class_TextEdit_signal_info_clicked:
  253. - **info_clicked** **(** :ref:`int<class_int>` row, :ref:`String<class_String>` info **)**
  254. Emitted when the info icon is clicked.
  255. ----
  256. .. _class_TextEdit_signal_request_completion:
  257. - **request_completion** **(** **)**
  258. ----
  259. .. _class_TextEdit_signal_symbol_lookup:
  260. - **symbol_lookup** **(** :ref:`String<class_String>` symbol, :ref:`int<class_int>` row, :ref:`int<class_int>` column **)**
  261. ----
  262. .. _class_TextEdit_signal_symbol_validate:
  263. - **symbol_validate** **(** :ref:`String<class_String>` symbol **)**
  264. ----
  265. .. _class_TextEdit_signal_text_changed:
  266. - **text_changed** **(** **)**
  267. Emitted when the text changes.
  268. Enumerations
  269. ------------
  270. .. _enum_TextEdit_SearchFlags:
  271. .. _class_TextEdit_constant_SEARCH_MATCH_CASE:
  272. .. _class_TextEdit_constant_SEARCH_WHOLE_WORDS:
  273. .. _class_TextEdit_constant_SEARCH_BACKWARDS:
  274. enum **SearchFlags**:
  275. - **SEARCH_MATCH_CASE** = **1** --- Match case when searching.
  276. - **SEARCH_WHOLE_WORDS** = **2** --- Match whole words when searching.
  277. - **SEARCH_BACKWARDS** = **4** --- Search from end to beginning.
  278. ----
  279. .. _enum_TextEdit_SearchResult:
  280. .. _class_TextEdit_constant_SEARCH_RESULT_COLUMN:
  281. .. _class_TextEdit_constant_SEARCH_RESULT_LINE:
  282. enum **SearchResult**:
  283. - **SEARCH_RESULT_COLUMN** = **0** --- Used to access the result column from :ref:`search<class_TextEdit_method_search>`.
  284. - **SEARCH_RESULT_LINE** = **1** --- Used to access the result line from :ref:`search<class_TextEdit_method_search>`.
  285. ----
  286. .. _enum_TextEdit_MenuItems:
  287. .. _class_TextEdit_constant_MENU_CUT:
  288. .. _class_TextEdit_constant_MENU_COPY:
  289. .. _class_TextEdit_constant_MENU_PASTE:
  290. .. _class_TextEdit_constant_MENU_CLEAR:
  291. .. _class_TextEdit_constant_MENU_SELECT_ALL:
  292. .. _class_TextEdit_constant_MENU_UNDO:
  293. .. _class_TextEdit_constant_MENU_REDO:
  294. .. _class_TextEdit_constant_MENU_MAX:
  295. enum **MenuItems**:
  296. - **MENU_CUT** = **0** --- Cuts (copies and clears) the selected text.
  297. - **MENU_COPY** = **1** --- Copies the selected text.
  298. - **MENU_PASTE** = **2** --- Pastes the clipboard text over the selected text (or at the cursor's position).
  299. - **MENU_CLEAR** = **3** --- Erases the whole ``TextEdit`` text.
  300. - **MENU_SELECT_ALL** = **4** --- Selects the whole ``TextEdit`` text.
  301. - **MENU_UNDO** = **5** --- Undoes the previous action.
  302. - **MENU_REDO** = **6** --- Redoes the previous action.
  303. - **MENU_MAX** = **7** --- Represents the size of the :ref:`MenuItems<enum_TextEdit_MenuItems>` enum.
  304. Property Descriptions
  305. ---------------------
  306. .. _class_TextEdit_property_breakpoint_gutter:
  307. - :ref:`bool<class_bool>` **breakpoint_gutter**
  308. +-----------+--------------------------------------+
  309. | *Default* | ``false`` |
  310. +-----------+--------------------------------------+
  311. | *Setter* | set_breakpoint_gutter_enabled(value) |
  312. +-----------+--------------------------------------+
  313. | *Getter* | is_breakpoint_gutter_enabled() |
  314. +-----------+--------------------------------------+
  315. If ``true``, the breakpoint gutter is visible.
  316. ----
  317. .. _class_TextEdit_property_caret_blink:
  318. - :ref:`bool<class_bool>` **caret_blink**
  319. +-----------+---------------------------------+
  320. | *Default* | ``false`` |
  321. +-----------+---------------------------------+
  322. | *Setter* | cursor_set_blink_enabled(value) |
  323. +-----------+---------------------------------+
  324. | *Getter* | cursor_get_blink_enabled() |
  325. +-----------+---------------------------------+
  326. If ``true``, the caret (visual cursor) blinks.
  327. ----
  328. .. _class_TextEdit_property_caret_blink_speed:
  329. - :ref:`float<class_float>` **caret_blink_speed**
  330. +-----------+-------------------------------+
  331. | *Default* | ``0.65`` |
  332. +-----------+-------------------------------+
  333. | *Setter* | cursor_set_blink_speed(value) |
  334. +-----------+-------------------------------+
  335. | *Getter* | cursor_get_blink_speed() |
  336. +-----------+-------------------------------+
  337. Duration (in seconds) of a caret's blinking cycle.
  338. ----
  339. .. _class_TextEdit_property_caret_block_mode:
  340. - :ref:`bool<class_bool>` **caret_block_mode**
  341. +-----------+------------------------------+
  342. | *Default* | ``false`` |
  343. +-----------+------------------------------+
  344. | *Setter* | cursor_set_block_mode(value) |
  345. +-----------+------------------------------+
  346. | *Getter* | cursor_is_block_mode() |
  347. +-----------+------------------------------+
  348. If ``true``, the caret displays as a rectangle.
  349. If ``false``, the caret displays as a bar.
  350. ----
  351. .. _class_TextEdit_property_caret_moving_by_right_click:
  352. - :ref:`bool<class_bool>` **caret_moving_by_right_click**
  353. +-----------+------------------------------------+
  354. | *Default* | ``true`` |
  355. +-----------+------------------------------------+
  356. | *Setter* | set_right_click_moves_caret(value) |
  357. +-----------+------------------------------------+
  358. | *Getter* | is_right_click_moving_caret() |
  359. +-----------+------------------------------------+
  360. If ``true``, a right-click moves the cursor at the mouse position before displaying the context menu.
  361. If ``false``, the context menu disregards mouse location.
  362. ----
  363. .. _class_TextEdit_property_context_menu_enabled:
  364. - :ref:`bool<class_bool>` **context_menu_enabled**
  365. +-----------+---------------------------------+
  366. | *Default* | ``true`` |
  367. +-----------+---------------------------------+
  368. | *Setter* | set_context_menu_enabled(value) |
  369. +-----------+---------------------------------+
  370. | *Getter* | is_context_menu_enabled() |
  371. +-----------+---------------------------------+
  372. If ``true``, a right-click displays the context menu.
  373. ----
  374. .. _class_TextEdit_property_draw_spaces:
  375. - :ref:`bool<class_bool>` **draw_spaces**
  376. +-----------+------------------------+
  377. | *Default* | ``false`` |
  378. +-----------+------------------------+
  379. | *Setter* | set_draw_spaces(value) |
  380. +-----------+------------------------+
  381. | *Getter* | is_drawing_spaces() |
  382. +-----------+------------------------+
  383. If ``true``, the "space" character will have a visible representation.
  384. ----
  385. .. _class_TextEdit_property_draw_tabs:
  386. - :ref:`bool<class_bool>` **draw_tabs**
  387. +-----------+----------------------+
  388. | *Default* | ``false`` |
  389. +-----------+----------------------+
  390. | *Setter* | set_draw_tabs(value) |
  391. +-----------+----------------------+
  392. | *Getter* | is_drawing_tabs() |
  393. +-----------+----------------------+
  394. If ``true``, the "tab" character will have a visible representation.
  395. ----
  396. .. _class_TextEdit_property_fold_gutter:
  397. - :ref:`bool<class_bool>` **fold_gutter**
  398. +-----------+-----------------------------+
  399. | *Default* | ``false`` |
  400. +-----------+-----------------------------+
  401. | *Setter* | set_draw_fold_gutter(value) |
  402. +-----------+-----------------------------+
  403. | *Getter* | is_drawing_fold_gutter() |
  404. +-----------+-----------------------------+
  405. If ``true``, the fold gutter is visible. This enables folding groups of indented lines.
  406. ----
  407. .. _class_TextEdit_property_hiding_enabled:
  408. - :ref:`bool<class_bool>` **hiding_enabled**
  409. +-----------+---------------------------+
  410. | *Default* | ``false`` |
  411. +-----------+---------------------------+
  412. | *Setter* | set_hiding_enabled(value) |
  413. +-----------+---------------------------+
  414. | *Getter* | is_hiding_enabled() |
  415. +-----------+---------------------------+
  416. 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.
  417. ----
  418. .. _class_TextEdit_property_highlight_all_occurrences:
  419. - :ref:`bool<class_bool>` **highlight_all_occurrences**
  420. +-----------+----------------------------------------+
  421. | *Default* | ``false`` |
  422. +-----------+----------------------------------------+
  423. | *Setter* | set_highlight_all_occurrences(value) |
  424. +-----------+----------------------------------------+
  425. | *Getter* | is_highlight_all_occurrences_enabled() |
  426. +-----------+----------------------------------------+
  427. If ``true``, all occurrences of the selected text will be highlighted.
  428. ----
  429. .. _class_TextEdit_property_highlight_current_line:
  430. - :ref:`bool<class_bool>` **highlight_current_line**
  431. +-----------+-------------------------------------+
  432. | *Default* | ``false`` |
  433. +-----------+-------------------------------------+
  434. | *Setter* | set_highlight_current_line(value) |
  435. +-----------+-------------------------------------+
  436. | *Getter* | is_highlight_current_line_enabled() |
  437. +-----------+-------------------------------------+
  438. If ``true``, the line containing the cursor is highlighted.
  439. ----
  440. .. _class_TextEdit_property_minimap_draw:
  441. - :ref:`bool<class_bool>` **minimap_draw**
  442. +-----------+----------------------+
  443. | *Default* | ``false`` |
  444. +-----------+----------------------+
  445. | *Setter* | draw_minimap(value) |
  446. +-----------+----------------------+
  447. | *Getter* | is_drawing_minimap() |
  448. +-----------+----------------------+
  449. ----
  450. .. _class_TextEdit_property_minimap_width:
  451. - :ref:`int<class_int>` **minimap_width**
  452. +-----------+--------------------------+
  453. | *Default* | ``80`` |
  454. +-----------+--------------------------+
  455. | *Setter* | set_minimap_width(value) |
  456. +-----------+--------------------------+
  457. | *Getter* | get_minimap_width() |
  458. +-----------+--------------------------+
  459. ----
  460. .. _class_TextEdit_property_override_selected_font_color:
  461. - :ref:`bool<class_bool>` **override_selected_font_color**
  462. +-----------+-----------------------------------------+
  463. | *Default* | ``false`` |
  464. +-----------+-----------------------------------------+
  465. | *Setter* | set_override_selected_font_color(value) |
  466. +-----------+-----------------------------------------+
  467. | *Getter* | is_overriding_selected_font_color() |
  468. +-----------+-----------------------------------------+
  469. ----
  470. .. _class_TextEdit_property_readonly:
  471. - :ref:`bool<class_bool>` **readonly**
  472. +-----------+---------------------+
  473. | *Default* | ``false`` |
  474. +-----------+---------------------+
  475. | *Setter* | set_readonly(value) |
  476. +-----------+---------------------+
  477. | *Getter* | is_readonly() |
  478. +-----------+---------------------+
  479. If ``true``, read-only mode is enabled. Existing text cannot be modified and new text cannot be added.
  480. ----
  481. .. _class_TextEdit_property_scroll_horizontal:
  482. - :ref:`int<class_int>` **scroll_horizontal**
  483. +-----------+---------------------+
  484. | *Default* | ``0`` |
  485. +-----------+---------------------+
  486. | *Setter* | set_h_scroll(value) |
  487. +-----------+---------------------+
  488. | *Getter* | get_h_scroll() |
  489. +-----------+---------------------+
  490. The current horizontal scroll value.
  491. ----
  492. .. _class_TextEdit_property_scroll_vertical:
  493. - :ref:`float<class_float>` **scroll_vertical**
  494. +-----------+---------------------+
  495. | *Default* | ``0.0`` |
  496. +-----------+---------------------+
  497. | *Setter* | set_v_scroll(value) |
  498. +-----------+---------------------+
  499. | *Getter* | get_v_scroll() |
  500. +-----------+---------------------+
  501. The current vertical scroll value.
  502. ----
  503. .. _class_TextEdit_property_selecting_enabled:
  504. - :ref:`bool<class_bool>` **selecting_enabled**
  505. +-----------+------------------------------+
  506. | *Default* | ``true`` |
  507. +-----------+------------------------------+
  508. | *Setter* | set_selecting_enabled(value) |
  509. +-----------+------------------------------+
  510. | *Getter* | is_selecting_enabled() |
  511. +-----------+------------------------------+
  512. ----
  513. .. _class_TextEdit_property_shortcut_keys_enabled:
  514. - :ref:`bool<class_bool>` **shortcut_keys_enabled**
  515. +-----------+----------------------------------+
  516. | *Default* | ``true`` |
  517. +-----------+----------------------------------+
  518. | *Setter* | set_shortcut_keys_enabled(value) |
  519. +-----------+----------------------------------+
  520. | *Getter* | is_shortcut_keys_enabled() |
  521. +-----------+----------------------------------+
  522. ----
  523. .. _class_TextEdit_property_show_line_numbers:
  524. - :ref:`bool<class_bool>` **show_line_numbers**
  525. +-----------+--------------------------------+
  526. | *Default* | ``false`` |
  527. +-----------+--------------------------------+
  528. | *Setter* | set_show_line_numbers(value) |
  529. +-----------+--------------------------------+
  530. | *Getter* | is_show_line_numbers_enabled() |
  531. +-----------+--------------------------------+
  532. If ``true``, line numbers are displayed to the left of the text.
  533. ----
  534. .. _class_TextEdit_property_smooth_scrolling:
  535. - :ref:`bool<class_bool>` **smooth_scrolling**
  536. +-----------+---------------------------------+
  537. | *Default* | ``false`` |
  538. +-----------+---------------------------------+
  539. | *Setter* | set_smooth_scroll_enable(value) |
  540. +-----------+---------------------------------+
  541. | *Getter* | is_smooth_scroll_enabled() |
  542. +-----------+---------------------------------+
  543. If ``true``, sets the ``step`` of the scrollbars to ``0.25`` which results in smoother scrolling.
  544. ----
  545. .. _class_TextEdit_property_syntax_highlighting:
  546. - :ref:`bool<class_bool>` **syntax_highlighting**
  547. +-----------+------------------------------+
  548. | *Default* | ``false`` |
  549. +-----------+------------------------------+
  550. | *Setter* | set_syntax_coloring(value) |
  551. +-----------+------------------------------+
  552. | *Getter* | is_syntax_coloring_enabled() |
  553. +-----------+------------------------------+
  554. If ``true``, any custom color properties that have been set for this ``TextEdit`` will be visible.
  555. ----
  556. .. _class_TextEdit_property_text:
  557. - :ref:`String<class_String>` **text**
  558. +-----------+-----------------+
  559. | *Default* | ``""`` |
  560. +-----------+-----------------+
  561. | *Setter* | set_text(value) |
  562. +-----------+-----------------+
  563. | *Getter* | get_text() |
  564. +-----------+-----------------+
  565. String value of the ``TextEdit``.
  566. ----
  567. .. _class_TextEdit_property_v_scroll_speed:
  568. - :ref:`float<class_float>` **v_scroll_speed**
  569. +-----------+---------------------------+
  570. | *Default* | ``80.0`` |
  571. +-----------+---------------------------+
  572. | *Setter* | set_v_scroll_speed(value) |
  573. +-----------+---------------------------+
  574. | *Getter* | get_v_scroll_speed() |
  575. +-----------+---------------------------+
  576. Vertical scroll sensitivity.
  577. ----
  578. .. _class_TextEdit_property_wrap_enabled:
  579. - :ref:`bool<class_bool>` **wrap_enabled**
  580. +-----------+-------------------------+
  581. | *Default* | ``false`` |
  582. +-----------+-------------------------+
  583. | *Setter* | set_wrap_enabled(value) |
  584. +-----------+-------------------------+
  585. | *Getter* | is_wrap_enabled() |
  586. +-----------+-------------------------+
  587. If ``true``, enables text wrapping when it goes beyond the edge of what is visible.
  588. Method Descriptions
  589. -------------------
  590. .. _class_TextEdit_method_add_color_region:
  591. - 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 **)**
  592. Adds color region (given the delimiters) and its colors.
  593. ----
  594. .. _class_TextEdit_method_add_keyword_color:
  595. - void **add_keyword_color** **(** :ref:`String<class_String>` keyword, :ref:`Color<class_Color>` color **)**
  596. Adds a ``keyword`` and its :ref:`Color<class_Color>`.
  597. ----
  598. .. _class_TextEdit_method_can_fold:
  599. - :ref:`bool<class_bool>` **can_fold** **(** :ref:`int<class_int>` line **)** const
  600. Returns if the given line is foldable, that is, it has indented lines right below it.
  601. ----
  602. .. _class_TextEdit_method_center_viewport_to_cursor:
  603. - void **center_viewport_to_cursor** **(** **)**
  604. ----
  605. .. _class_TextEdit_method_clear_colors:
  606. - void **clear_colors** **(** **)**
  607. 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>`.
  608. ----
  609. .. _class_TextEdit_method_clear_undo_history:
  610. - void **clear_undo_history** **(** **)**
  611. Clears the undo history.
  612. ----
  613. .. _class_TextEdit_method_copy:
  614. - void **copy** **(** **)**
  615. Copy's the current text selection.
  616. ----
  617. .. _class_TextEdit_method_cursor_get_column:
  618. - :ref:`int<class_int>` **cursor_get_column** **(** **)** const
  619. Returns the column the editing cursor is at.
  620. ----
  621. .. _class_TextEdit_method_cursor_get_line:
  622. - :ref:`int<class_int>` **cursor_get_line** **(** **)** const
  623. Returns the line the editing cursor is at.
  624. ----
  625. .. _class_TextEdit_method_cursor_set_column:
  626. - void **cursor_set_column** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)**
  627. Moves the cursor at the specified ``column`` index.
  628. If ``adjust_viewport`` is set to ``true``, the viewport will center at the cursor position after the move occurs.
  629. ----
  630. .. _class_TextEdit_method_cursor_set_line:
  631. - 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 **)**
  632. Moves the cursor at the specified ``line`` index.
  633. If ``adjust_viewport`` is set to ``true``, the viewport will center at the cursor position after the move occurs.
  634. 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>`.
  635. ----
  636. .. _class_TextEdit_method_cut:
  637. - void **cut** **(** **)**
  638. Cut's the current selection.
  639. ----
  640. .. _class_TextEdit_method_deselect:
  641. - void **deselect** **(** **)**
  642. Deselects the current selection.
  643. ----
  644. .. _class_TextEdit_method_fold_all_lines:
  645. - void **fold_all_lines** **(** **)**
  646. Folds all lines that are possible to be folded (see :ref:`can_fold<class_TextEdit_method_can_fold>`).
  647. ----
  648. .. _class_TextEdit_method_fold_line:
  649. - void **fold_line** **(** :ref:`int<class_int>` line **)**
  650. Folds the given line, if possible (see :ref:`can_fold<class_TextEdit_method_can_fold>`).
  651. ----
  652. .. _class_TextEdit_method_get_breakpoints:
  653. - :ref:`Array<class_Array>` **get_breakpoints** **(** **)** const
  654. Returns an array containing the line number of each breakpoint.
  655. ----
  656. .. _class_TextEdit_method_get_keyword_color:
  657. - :ref:`Color<class_Color>` **get_keyword_color** **(** :ref:`String<class_String>` keyword **)** const
  658. Returns the :ref:`Color<class_Color>` of the specified ``keyword``.
  659. ----
  660. .. _class_TextEdit_method_get_line:
  661. - :ref:`String<class_String>` **get_line** **(** :ref:`int<class_int>` line **)** const
  662. Returns the text of a specific line.
  663. ----
  664. .. _class_TextEdit_method_get_line_count:
  665. - :ref:`int<class_int>` **get_line_count** **(** **)** const
  666. Returns the amount of total lines in the text.
  667. ----
  668. .. _class_TextEdit_method_get_menu:
  669. - :ref:`PopupMenu<class_PopupMenu>` **get_menu** **(** **)** const
  670. Returns the :ref:`PopupMenu<class_PopupMenu>` of this ``TextEdit``. By default, this menu is displayed when right-clicking on the ``TextEdit``.
  671. ----
  672. .. _class_TextEdit_method_get_selection_from_column:
  673. - :ref:`int<class_int>` **get_selection_from_column** **(** **)** const
  674. Returns the selection begin column.
  675. ----
  676. .. _class_TextEdit_method_get_selection_from_line:
  677. - :ref:`int<class_int>` **get_selection_from_line** **(** **)** const
  678. Returns the selection begin line.
  679. ----
  680. .. _class_TextEdit_method_get_selection_text:
  681. - :ref:`String<class_String>` **get_selection_text** **(** **)** const
  682. Returns the text inside the selection.
  683. ----
  684. .. _class_TextEdit_method_get_selection_to_column:
  685. - :ref:`int<class_int>` **get_selection_to_column** **(** **)** const
  686. Returns the selection end column.
  687. ----
  688. .. _class_TextEdit_method_get_selection_to_line:
  689. - :ref:`int<class_int>` **get_selection_to_line** **(** **)** const
  690. Returns the selection end line.
  691. ----
  692. .. _class_TextEdit_method_get_word_under_cursor:
  693. - :ref:`String<class_String>` **get_word_under_cursor** **(** **)** const
  694. Returns a :ref:`String<class_String>` text with the word under the mouse cursor location.
  695. ----
  696. .. _class_TextEdit_method_has_keyword_color:
  697. - :ref:`bool<class_bool>` **has_keyword_color** **(** :ref:`String<class_String>` keyword **)** const
  698. Returns whether the specified ``keyword`` has a color set to it or not.
  699. ----
  700. .. _class_TextEdit_method_insert_text_at_cursor:
  701. - void **insert_text_at_cursor** **(** :ref:`String<class_String>` text **)**
  702. Insert the specified text at the cursor position.
  703. ----
  704. .. _class_TextEdit_method_is_folded:
  705. - :ref:`bool<class_bool>` **is_folded** **(** :ref:`int<class_int>` line **)** const
  706. Returns whether the line at the specified index is folded or not.
  707. ----
  708. .. _class_TextEdit_method_is_line_hidden:
  709. - :ref:`bool<class_bool>` **is_line_hidden** **(** :ref:`int<class_int>` line **)** const
  710. Returns whether the line at the specified index is hidden or not.
  711. ----
  712. .. _class_TextEdit_method_is_selection_active:
  713. - :ref:`bool<class_bool>` **is_selection_active** **(** **)** const
  714. Returns ``true`` if the selection is active.
  715. ----
  716. .. _class_TextEdit_method_menu_option:
  717. - void **menu_option** **(** :ref:`int<class_int>` option **)**
  718. Triggers a right-click menu action by the specified index. See :ref:`MenuItems<enum_TextEdit_MenuItems>` for a list of available indexes.
  719. ----
  720. .. _class_TextEdit_method_paste:
  721. - void **paste** **(** **)**
  722. Paste the current selection.
  723. ----
  724. .. _class_TextEdit_method_redo:
  725. - void **redo** **(** **)**
  726. Perform redo operation.
  727. ----
  728. .. _class_TextEdit_method_remove_breakpoints:
  729. - void **remove_breakpoints** **(** **)**
  730. Removes all the breakpoints. This will not fire the :ref:`breakpoint_toggled<class_TextEdit_signal_breakpoint_toggled>` signal.
  731. ----
  732. .. _class_TextEdit_method_search:
  733. - :ref:`PackedInt32Array<class_PackedInt32Array>` **search** **(** :ref:`String<class_String>` key, :ref:`int<class_int>` flags, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column **)** const
  734. Perform a search inside the text. Search flags can be specified in the :ref:`SearchFlags<enum_TextEdit_SearchFlags>` enum.
  735. Returns an empty ``PackedInt32Array`` 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:
  736. ::
  737. var result = search(key, flags, line, column)
  738. if result.size() > 0:
  739. # Result found.
  740. var res_line = result[TextEdit.SEARCH_RESULT_LINE]
  741. var res_column = result[TextEdit.SEARCH_RESULT_COLUMN]
  742. ----
  743. .. _class_TextEdit_method_select:
  744. - 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 **)**
  745. Perform selection, from line/column to line/column.
  746. ----
  747. .. _class_TextEdit_method_select_all:
  748. - void **select_all** **(** **)**
  749. Select all the text.
  750. ----
  751. .. _class_TextEdit_method_set_line_as_hidden:
  752. - void **set_line_as_hidden** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` enable **)**
  753. If ``true``, hides the line of the specified index.
  754. ----
  755. .. _class_TextEdit_method_toggle_fold_line:
  756. - void **toggle_fold_line** **(** :ref:`int<class_int>` line **)**
  757. Toggle the folding of the code block at the given line.
  758. ----
  759. .. _class_TextEdit_method_undo:
  760. - void **undo** **(** **)**
  761. Perform undo operation.
  762. ----
  763. .. _class_TextEdit_method_unfold_line:
  764. - void **unfold_line** **(** :ref:`int<class_int>` line **)**
  765. Unfolds the given line, if folded.
  766. ----
  767. .. _class_TextEdit_method_unhide_all_lines:
  768. - void **unhide_all_lines** **(** **)**
  769. Unhide all lines that were previously set to hidden by :ref:`set_line_as_hidden<class_TextEdit_method_set_line_as_hidden>`.