class_textedit.rst 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141
  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:`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 |
  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:`Texture<class_Texture>` | fold | |
  203. +---------------------------------+-----------------------------+---------------------------------+
  204. | :ref:`Texture<class_Texture>` | 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:`Texture<class_Texture>` | space | |
  235. +---------------------------------+-----------------------------+---------------------------------+
  236. | :ref:`Color<class_Color>` | symbol_color | Color( 0.94, 0.94, 0.94, 1 ) |
  237. +---------------------------------+-----------------------------+---------------------------------+
  238. | :ref:`Texture<class_Texture>` | 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_text_changed:
  263. - **text_changed** **(** **)**
  264. Emitted when the text changes.
  265. Enumerations
  266. ------------
  267. .. _enum_TextEdit_SearchFlags:
  268. .. _class_TextEdit_constant_SEARCH_MATCH_CASE:
  269. .. _class_TextEdit_constant_SEARCH_WHOLE_WORDS:
  270. .. _class_TextEdit_constant_SEARCH_BACKWARDS:
  271. enum **SearchFlags**:
  272. - **SEARCH_MATCH_CASE** = **1** --- Match case when searching.
  273. - **SEARCH_WHOLE_WORDS** = **2** --- Match whole words when searching.
  274. - **SEARCH_BACKWARDS** = **4** --- Search from end to beginning.
  275. ----
  276. .. _enum_TextEdit_SearchResult:
  277. .. _class_TextEdit_constant_SEARCH_RESULT_COLUMN:
  278. .. _class_TextEdit_constant_SEARCH_RESULT_LINE:
  279. enum **SearchResult**:
  280. - **SEARCH_RESULT_COLUMN** = **0** --- Used to access the result column from :ref:`search<class_TextEdit_method_search>`.
  281. - **SEARCH_RESULT_LINE** = **1** --- Used to access the result line from :ref:`search<class_TextEdit_method_search>`.
  282. ----
  283. .. _enum_TextEdit_MenuItems:
  284. .. _class_TextEdit_constant_MENU_CUT:
  285. .. _class_TextEdit_constant_MENU_COPY:
  286. .. _class_TextEdit_constant_MENU_PASTE:
  287. .. _class_TextEdit_constant_MENU_CLEAR:
  288. .. _class_TextEdit_constant_MENU_SELECT_ALL:
  289. .. _class_TextEdit_constant_MENU_UNDO:
  290. .. _class_TextEdit_constant_MENU_REDO:
  291. .. _class_TextEdit_constant_MENU_MAX:
  292. enum **MenuItems**:
  293. - **MENU_CUT** = **0** --- Cuts (copies and clears) the selected text.
  294. - **MENU_COPY** = **1** --- Copies the selected text.
  295. - **MENU_PASTE** = **2** --- Pastes the clipboard text over the selected text (or at the cursor's position).
  296. - **MENU_CLEAR** = **3** --- Erases the whole ``TextEdit`` text.
  297. - **MENU_SELECT_ALL** = **4** --- Selects the whole ``TextEdit`` text.
  298. - **MENU_UNDO** = **5** --- Undoes the previous action.
  299. - **MENU_REDO** = **6** --- Redoes the previous action.
  300. - **MENU_MAX** = **7** --- Represents the size of the :ref:`MenuItems<enum_TextEdit_MenuItems>` enum.
  301. Property Descriptions
  302. ---------------------
  303. .. _class_TextEdit_property_breakpoint_gutter:
  304. - :ref:`bool<class_bool>` **breakpoint_gutter**
  305. +-----------+--------------------------------------+
  306. | *Default* | ``false`` |
  307. +-----------+--------------------------------------+
  308. | *Setter* | set_breakpoint_gutter_enabled(value) |
  309. +-----------+--------------------------------------+
  310. | *Getter* | is_breakpoint_gutter_enabled() |
  311. +-----------+--------------------------------------+
  312. If ``true``, the breakpoint gutter is visible.
  313. ----
  314. .. _class_TextEdit_property_caret_blink:
  315. - :ref:`bool<class_bool>` **caret_blink**
  316. +-----------+---------------------------------+
  317. | *Default* | ``false`` |
  318. +-----------+---------------------------------+
  319. | *Setter* | cursor_set_blink_enabled(value) |
  320. +-----------+---------------------------------+
  321. | *Getter* | cursor_get_blink_enabled() |
  322. +-----------+---------------------------------+
  323. If ``true``, the caret (visual cursor) blinks.
  324. ----
  325. .. _class_TextEdit_property_caret_blink_speed:
  326. - :ref:`float<class_float>` **caret_blink_speed**
  327. +-----------+-------------------------------+
  328. | *Default* | ``0.65`` |
  329. +-----------+-------------------------------+
  330. | *Setter* | cursor_set_blink_speed(value) |
  331. +-----------+-------------------------------+
  332. | *Getter* | cursor_get_blink_speed() |
  333. +-----------+-------------------------------+
  334. Duration (in seconds) of a caret's blinking cycle.
  335. ----
  336. .. _class_TextEdit_property_caret_block_mode:
  337. - :ref:`bool<class_bool>` **caret_block_mode**
  338. +-----------+------------------------------+
  339. | *Default* | ``false`` |
  340. +-----------+------------------------------+
  341. | *Setter* | cursor_set_block_mode(value) |
  342. +-----------+------------------------------+
  343. | *Getter* | cursor_is_block_mode() |
  344. +-----------+------------------------------+
  345. If ``true``, the caret displays as a rectangle.
  346. If ``false``, the caret displays as a bar.
  347. ----
  348. .. _class_TextEdit_property_caret_moving_by_right_click:
  349. - :ref:`bool<class_bool>` **caret_moving_by_right_click**
  350. +-----------+------------------------------------+
  351. | *Default* | ``true`` |
  352. +-----------+------------------------------------+
  353. | *Setter* | set_right_click_moves_caret(value) |
  354. +-----------+------------------------------------+
  355. | *Getter* | is_right_click_moving_caret() |
  356. +-----------+------------------------------------+
  357. If ``true``, a right-click moves the cursor at the mouse position before displaying the context menu.
  358. If ``false``, the context menu disregards mouse location.
  359. ----
  360. .. _class_TextEdit_property_context_menu_enabled:
  361. - :ref:`bool<class_bool>` **context_menu_enabled**
  362. +-----------+---------------------------------+
  363. | *Default* | ``true`` |
  364. +-----------+---------------------------------+
  365. | *Setter* | set_context_menu_enabled(value) |
  366. +-----------+---------------------------------+
  367. | *Getter* | is_context_menu_enabled() |
  368. +-----------+---------------------------------+
  369. If ``true``, a right-click displays the context menu.
  370. ----
  371. .. _class_TextEdit_property_draw_spaces:
  372. - :ref:`bool<class_bool>` **draw_spaces**
  373. +-----------+------------------------+
  374. | *Default* | ``false`` |
  375. +-----------+------------------------+
  376. | *Setter* | set_draw_spaces(value) |
  377. +-----------+------------------------+
  378. | *Getter* | is_drawing_spaces() |
  379. +-----------+------------------------+
  380. If ``true``, the "space" character will have a visible representation.
  381. ----
  382. .. _class_TextEdit_property_draw_tabs:
  383. - :ref:`bool<class_bool>` **draw_tabs**
  384. +-----------+----------------------+
  385. | *Default* | ``false`` |
  386. +-----------+----------------------+
  387. | *Setter* | set_draw_tabs(value) |
  388. +-----------+----------------------+
  389. | *Getter* | is_drawing_tabs() |
  390. +-----------+----------------------+
  391. If ``true``, the "tab" character will have a visible representation.
  392. ----
  393. .. _class_TextEdit_property_fold_gutter:
  394. - :ref:`bool<class_bool>` **fold_gutter**
  395. +-----------+-----------------------------+
  396. | *Default* | ``false`` |
  397. +-----------+-----------------------------+
  398. | *Setter* | set_draw_fold_gutter(value) |
  399. +-----------+-----------------------------+
  400. | *Getter* | is_drawing_fold_gutter() |
  401. +-----------+-----------------------------+
  402. If ``true``, the fold gutter is visible. This enables folding groups of indented lines.
  403. ----
  404. .. _class_TextEdit_property_hiding_enabled:
  405. - :ref:`bool<class_bool>` **hiding_enabled**
  406. +-----------+---------------------------+
  407. | *Default* | ``false`` |
  408. +-----------+---------------------------+
  409. | *Setter* | set_hiding_enabled(value) |
  410. +-----------+---------------------------+
  411. | *Getter* | is_hiding_enabled() |
  412. +-----------+---------------------------+
  413. 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.
  414. ----
  415. .. _class_TextEdit_property_highlight_all_occurrences:
  416. - :ref:`bool<class_bool>` **highlight_all_occurrences**
  417. +-----------+----------------------------------------+
  418. | *Default* | ``false`` |
  419. +-----------+----------------------------------------+
  420. | *Setter* | set_highlight_all_occurrences(value) |
  421. +-----------+----------------------------------------+
  422. | *Getter* | is_highlight_all_occurrences_enabled() |
  423. +-----------+----------------------------------------+
  424. If ``true``, all occurrences of the selected text will be highlighted.
  425. ----
  426. .. _class_TextEdit_property_highlight_current_line:
  427. - :ref:`bool<class_bool>` **highlight_current_line**
  428. +-----------+-------------------------------------+
  429. | *Default* | ``false`` |
  430. +-----------+-------------------------------------+
  431. | *Setter* | set_highlight_current_line(value) |
  432. +-----------+-------------------------------------+
  433. | *Getter* | is_highlight_current_line_enabled() |
  434. +-----------+-------------------------------------+
  435. If ``true``, the line containing the cursor is highlighted.
  436. ----
  437. .. _class_TextEdit_property_minimap_draw:
  438. - :ref:`bool<class_bool>` **minimap_draw**
  439. +-----------+----------------------+
  440. | *Default* | ``false`` |
  441. +-----------+----------------------+
  442. | *Setter* | draw_minimap(value) |
  443. +-----------+----------------------+
  444. | *Getter* | is_drawing_minimap() |
  445. +-----------+----------------------+
  446. ----
  447. .. _class_TextEdit_property_minimap_width:
  448. - :ref:`int<class_int>` **minimap_width**
  449. +-----------+--------------------------+
  450. | *Default* | ``80`` |
  451. +-----------+--------------------------+
  452. | *Setter* | set_minimap_width(value) |
  453. +-----------+--------------------------+
  454. | *Getter* | get_minimap_width() |
  455. +-----------+--------------------------+
  456. ----
  457. .. _class_TextEdit_property_override_selected_font_color:
  458. - :ref:`bool<class_bool>` **override_selected_font_color**
  459. +-----------+-----------------------------------------+
  460. | *Default* | ``false`` |
  461. +-----------+-----------------------------------------+
  462. | *Setter* | set_override_selected_font_color(value) |
  463. +-----------+-----------------------------------------+
  464. | *Getter* | is_overriding_selected_font_color() |
  465. +-----------+-----------------------------------------+
  466. ----
  467. .. _class_TextEdit_property_readonly:
  468. - :ref:`bool<class_bool>` **readonly**
  469. +-----------+---------------------+
  470. | *Default* | ``false`` |
  471. +-----------+---------------------+
  472. | *Setter* | set_readonly(value) |
  473. +-----------+---------------------+
  474. | *Getter* | is_readonly() |
  475. +-----------+---------------------+
  476. If ``true``, read-only mode is enabled. Existing text cannot be modified and new text cannot be added.
  477. ----
  478. .. _class_TextEdit_property_scroll_horizontal:
  479. - :ref:`int<class_int>` **scroll_horizontal**
  480. +-----------+---------------------+
  481. | *Default* | ``0`` |
  482. +-----------+---------------------+
  483. | *Setter* | set_h_scroll(value) |
  484. +-----------+---------------------+
  485. | *Getter* | get_h_scroll() |
  486. +-----------+---------------------+
  487. The current horizontal scroll value.
  488. ----
  489. .. _class_TextEdit_property_scroll_vertical:
  490. - :ref:`float<class_float>` **scroll_vertical**
  491. +-----------+---------------------+
  492. | *Default* | ``0.0`` |
  493. +-----------+---------------------+
  494. | *Setter* | set_v_scroll(value) |
  495. +-----------+---------------------+
  496. | *Getter* | get_v_scroll() |
  497. +-----------+---------------------+
  498. The current vertical scroll value.
  499. ----
  500. .. _class_TextEdit_property_selecting_enabled:
  501. - :ref:`bool<class_bool>` **selecting_enabled**
  502. +-----------+------------------------------+
  503. | *Default* | ``true`` |
  504. +-----------+------------------------------+
  505. | *Setter* | set_selecting_enabled(value) |
  506. +-----------+------------------------------+
  507. | *Getter* | is_selecting_enabled() |
  508. +-----------+------------------------------+
  509. ----
  510. .. _class_TextEdit_property_shortcut_keys_enabled:
  511. - :ref:`bool<class_bool>` **shortcut_keys_enabled**
  512. +-----------+----------------------------------+
  513. | *Default* | ``true`` |
  514. +-----------+----------------------------------+
  515. | *Setter* | set_shortcut_keys_enabled(value) |
  516. +-----------+----------------------------------+
  517. | *Getter* | is_shortcut_keys_enabled() |
  518. +-----------+----------------------------------+
  519. ----
  520. .. _class_TextEdit_property_show_line_numbers:
  521. - :ref:`bool<class_bool>` **show_line_numbers**
  522. +-----------+--------------------------------+
  523. | *Default* | ``false`` |
  524. +-----------+--------------------------------+
  525. | *Setter* | set_show_line_numbers(value) |
  526. +-----------+--------------------------------+
  527. | *Getter* | is_show_line_numbers_enabled() |
  528. +-----------+--------------------------------+
  529. If ``true``, line numbers are displayed to the left of the text.
  530. ----
  531. .. _class_TextEdit_property_smooth_scrolling:
  532. - :ref:`bool<class_bool>` **smooth_scrolling**
  533. +-----------+---------------------------------+
  534. | *Default* | ``false`` |
  535. +-----------+---------------------------------+
  536. | *Setter* | set_smooth_scroll_enable(value) |
  537. +-----------+---------------------------------+
  538. | *Getter* | is_smooth_scroll_enabled() |
  539. +-----------+---------------------------------+
  540. If ``true``, sets the ``step`` of the scrollbars to ``0.25`` which results in smoother scrolling.
  541. ----
  542. .. _class_TextEdit_property_syntax_highlighting:
  543. - :ref:`bool<class_bool>` **syntax_highlighting**
  544. +-----------+------------------------------+
  545. | *Default* | ``false`` |
  546. +-----------+------------------------------+
  547. | *Setter* | set_syntax_coloring(value) |
  548. +-----------+------------------------------+
  549. | *Getter* | is_syntax_coloring_enabled() |
  550. +-----------+------------------------------+
  551. If ``true``, any custom color properties that have been set for this ``TextEdit`` will be visible.
  552. ----
  553. .. _class_TextEdit_property_text:
  554. - :ref:`String<class_String>` **text**
  555. +-----------+-----------------+
  556. | *Default* | ``""`` |
  557. +-----------+-----------------+
  558. | *Setter* | set_text(value) |
  559. +-----------+-----------------+
  560. | *Getter* | get_text() |
  561. +-----------+-----------------+
  562. String value of the ``TextEdit``.
  563. ----
  564. .. _class_TextEdit_property_v_scroll_speed:
  565. - :ref:`float<class_float>` **v_scroll_speed**
  566. +-----------+---------------------------+
  567. | *Default* | ``80.0`` |
  568. +-----------+---------------------------+
  569. | *Setter* | set_v_scroll_speed(value) |
  570. +-----------+---------------------------+
  571. | *Getter* | get_v_scroll_speed() |
  572. +-----------+---------------------------+
  573. Vertical scroll sensitivity.
  574. ----
  575. .. _class_TextEdit_property_wrap_enabled:
  576. - :ref:`bool<class_bool>` **wrap_enabled**
  577. +-----------+-------------------------+
  578. | *Default* | ``false`` |
  579. +-----------+-------------------------+
  580. | *Setter* | set_wrap_enabled(value) |
  581. +-----------+-------------------------+
  582. | *Getter* | is_wrap_enabled() |
  583. +-----------+-------------------------+
  584. If ``true``, enables text wrapping when it goes beyond the edge of what is visible.
  585. Method Descriptions
  586. -------------------
  587. .. _class_TextEdit_method_add_color_region:
  588. - 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 **)**
  589. Adds color region (given the delimiters) and its colors.
  590. ----
  591. .. _class_TextEdit_method_add_keyword_color:
  592. - void **add_keyword_color** **(** :ref:`String<class_String>` keyword, :ref:`Color<class_Color>` color **)**
  593. Adds a ``keyword`` and its :ref:`Color<class_Color>`.
  594. ----
  595. .. _class_TextEdit_method_can_fold:
  596. - :ref:`bool<class_bool>` **can_fold** **(** :ref:`int<class_int>` line **)** const
  597. Returns if the given line is foldable, that is, it has indented lines right below it.
  598. ----
  599. .. _class_TextEdit_method_center_viewport_to_cursor:
  600. - void **center_viewport_to_cursor** **(** **)**
  601. ----
  602. .. _class_TextEdit_method_clear_colors:
  603. - void **clear_colors** **(** **)**
  604. 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>`.
  605. ----
  606. .. _class_TextEdit_method_clear_undo_history:
  607. - void **clear_undo_history** **(** **)**
  608. Clears the undo history.
  609. ----
  610. .. _class_TextEdit_method_copy:
  611. - void **copy** **(** **)**
  612. Copy's the current text selection.
  613. ----
  614. .. _class_TextEdit_method_cursor_get_column:
  615. - :ref:`int<class_int>` **cursor_get_column** **(** **)** const
  616. Returns the column the editing cursor is at.
  617. ----
  618. .. _class_TextEdit_method_cursor_get_line:
  619. - :ref:`int<class_int>` **cursor_get_line** **(** **)** const
  620. Returns the line the editing cursor is at.
  621. ----
  622. .. _class_TextEdit_method_cursor_set_column:
  623. - void **cursor_set_column** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)**
  624. Moves the cursor at the specified ``column`` index.
  625. If ``adjust_viewport`` is set to ``true``, the viewport will center at the cursor position after the move occurs.
  626. ----
  627. .. _class_TextEdit_method_cursor_set_line:
  628. - 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 **)**
  629. Moves the cursor at the specified ``line`` index.
  630. If ``adjust_viewport`` is set to ``true``, the viewport will center at the cursor position after the move occurs.
  631. 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>`.
  632. ----
  633. .. _class_TextEdit_method_cut:
  634. - void **cut** **(** **)**
  635. Cut's the current selection.
  636. ----
  637. .. _class_TextEdit_method_deselect:
  638. - void **deselect** **(** **)**
  639. Deselects the current selection.
  640. ----
  641. .. _class_TextEdit_method_fold_all_lines:
  642. - void **fold_all_lines** **(** **)**
  643. Folds all lines that are possible to be folded (see :ref:`can_fold<class_TextEdit_method_can_fold>`).
  644. ----
  645. .. _class_TextEdit_method_fold_line:
  646. - void **fold_line** **(** :ref:`int<class_int>` line **)**
  647. Folds the given line, if possible (see :ref:`can_fold<class_TextEdit_method_can_fold>`).
  648. ----
  649. .. _class_TextEdit_method_get_breakpoints:
  650. - :ref:`Array<class_Array>` **get_breakpoints** **(** **)** const
  651. Returns an array containing the line number of each breakpoint.
  652. ----
  653. .. _class_TextEdit_method_get_keyword_color:
  654. - :ref:`Color<class_Color>` **get_keyword_color** **(** :ref:`String<class_String>` keyword **)** const
  655. Returns the :ref:`Color<class_Color>` of the specified ``keyword``.
  656. ----
  657. .. _class_TextEdit_method_get_line:
  658. - :ref:`String<class_String>` **get_line** **(** :ref:`int<class_int>` line **)** const
  659. Returns the text of a specific line.
  660. ----
  661. .. _class_TextEdit_method_get_line_count:
  662. - :ref:`int<class_int>` **get_line_count** **(** **)** const
  663. Returns the amount of total lines in the text.
  664. ----
  665. .. _class_TextEdit_method_get_menu:
  666. - :ref:`PopupMenu<class_PopupMenu>` **get_menu** **(** **)** const
  667. Returns the :ref:`PopupMenu<class_PopupMenu>` of this ``TextEdit``. By default, this menu is displayed when right-clicking on the ``TextEdit``.
  668. ----
  669. .. _class_TextEdit_method_get_selection_from_column:
  670. - :ref:`int<class_int>` **get_selection_from_column** **(** **)** const
  671. Returns the selection begin column.
  672. ----
  673. .. _class_TextEdit_method_get_selection_from_line:
  674. - :ref:`int<class_int>` **get_selection_from_line** **(** **)** const
  675. Returns the selection begin line.
  676. ----
  677. .. _class_TextEdit_method_get_selection_text:
  678. - :ref:`String<class_String>` **get_selection_text** **(** **)** const
  679. Returns the text inside the selection.
  680. ----
  681. .. _class_TextEdit_method_get_selection_to_column:
  682. - :ref:`int<class_int>` **get_selection_to_column** **(** **)** const
  683. Returns the selection end column.
  684. ----
  685. .. _class_TextEdit_method_get_selection_to_line:
  686. - :ref:`int<class_int>` **get_selection_to_line** **(** **)** const
  687. Returns the selection end line.
  688. ----
  689. .. _class_TextEdit_method_get_word_under_cursor:
  690. - :ref:`String<class_String>` **get_word_under_cursor** **(** **)** const
  691. Returns a :ref:`String<class_String>` text with the word under the mouse cursor location.
  692. ----
  693. .. _class_TextEdit_method_has_keyword_color:
  694. - :ref:`bool<class_bool>` **has_keyword_color** **(** :ref:`String<class_String>` keyword **)** const
  695. Returns whether the specified ``keyword`` has a color set to it or not.
  696. ----
  697. .. _class_TextEdit_method_insert_text_at_cursor:
  698. - void **insert_text_at_cursor** **(** :ref:`String<class_String>` text **)**
  699. Insert the specified text at the cursor position.
  700. ----
  701. .. _class_TextEdit_method_is_folded:
  702. - :ref:`bool<class_bool>` **is_folded** **(** :ref:`int<class_int>` line **)** const
  703. Returns whether the line at the specified index is folded or not.
  704. ----
  705. .. _class_TextEdit_method_is_line_hidden:
  706. - :ref:`bool<class_bool>` **is_line_hidden** **(** :ref:`int<class_int>` line **)** const
  707. Returns whether the line at the specified index is hidden or not.
  708. ----
  709. .. _class_TextEdit_method_is_selection_active:
  710. - :ref:`bool<class_bool>` **is_selection_active** **(** **)** const
  711. Returns ``true`` if the selection is active.
  712. ----
  713. .. _class_TextEdit_method_menu_option:
  714. - void **menu_option** **(** :ref:`int<class_int>` option **)**
  715. Triggers a right-click menu action by the specified index. See :ref:`MenuItems<enum_TextEdit_MenuItems>` for a list of available indexes.
  716. ----
  717. .. _class_TextEdit_method_paste:
  718. - void **paste** **(** **)**
  719. Paste the current selection.
  720. ----
  721. .. _class_TextEdit_method_redo:
  722. - void **redo** **(** **)**
  723. Perform redo operation.
  724. ----
  725. .. _class_TextEdit_method_remove_breakpoints:
  726. - void **remove_breakpoints** **(** **)**
  727. Removes all the breakpoints. This will not fire the :ref:`breakpoint_toggled<class_TextEdit_signal_breakpoint_toggled>` signal.
  728. ----
  729. .. _class_TextEdit_method_search:
  730. - :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
  731. Perform a search inside the text. Search flags can be specified in the :ref:`SearchFlags<enum_TextEdit_SearchFlags>` enum.
  732. 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:
  733. ::
  734. var result = search(key, flags, line, column)
  735. if result.size() > 0:
  736. # Result found.
  737. var res_line = result[TextEdit.SEARCH_RESULT_LINE]
  738. var res_column = result[TextEdit.SEARCH_RESULT_COLUMN]
  739. ----
  740. .. _class_TextEdit_method_select:
  741. - 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 **)**
  742. Perform selection, from line/column to line/column.
  743. ----
  744. .. _class_TextEdit_method_select_all:
  745. - void **select_all** **(** **)**
  746. Select all the text.
  747. ----
  748. .. _class_TextEdit_method_set_line_as_hidden:
  749. - void **set_line_as_hidden** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` enable **)**
  750. If ``true``, hides the line of the specified index.
  751. ----
  752. .. _class_TextEdit_method_toggle_fold_line:
  753. - void **toggle_fold_line** **(** :ref:`int<class_int>` line **)**
  754. Toggle the folding of the code block at the given line.
  755. ----
  756. .. _class_TextEdit_method_undo:
  757. - void **undo** **(** **)**
  758. Perform undo operation.
  759. ----
  760. .. _class_TextEdit_method_unfold_line:
  761. - void **unfold_line** **(** :ref:`int<class_int>` line **)**
  762. Unfolds the given line, if folded.
  763. ----
  764. .. _class_TextEdit_method_unhide_all_lines:
  765. - void **unhide_all_lines** **(** **)**
  766. Unhide all lines that were previously set to hidden by :ref:`set_line_as_hidden<class_TextEdit_method_set_line_as_hidden>`.