class_textedit.rst 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143
  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 | ``2`` *(parent override)* |
  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 | ``1`` *(parent override)* |
  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. If ``true``, custom ``font_color_selected`` will be used for selected text.
  467. ----
  468. .. _class_TextEdit_property_readonly:
  469. - :ref:`bool<class_bool>` **readonly**
  470. +-----------+---------------------+
  471. | *Default* | ``false`` |
  472. +-----------+---------------------+
  473. | *Setter* | set_readonly(value) |
  474. +-----------+---------------------+
  475. | *Getter* | is_readonly() |
  476. +-----------+---------------------+
  477. If ``true``, read-only mode is enabled. Existing text cannot be modified and new text cannot be added.
  478. ----
  479. .. _class_TextEdit_property_scroll_horizontal:
  480. - :ref:`int<class_int>` **scroll_horizontal**
  481. +-----------+---------------------+
  482. | *Default* | ``0`` |
  483. +-----------+---------------------+
  484. | *Setter* | set_h_scroll(value) |
  485. +-----------+---------------------+
  486. | *Getter* | get_h_scroll() |
  487. +-----------+---------------------+
  488. The current horizontal scroll value.
  489. ----
  490. .. _class_TextEdit_property_scroll_vertical:
  491. - :ref:`float<class_float>` **scroll_vertical**
  492. +-----------+---------------------+
  493. | *Default* | ``0.0`` |
  494. +-----------+---------------------+
  495. | *Setter* | set_v_scroll(value) |
  496. +-----------+---------------------+
  497. | *Getter* | get_v_scroll() |
  498. +-----------+---------------------+
  499. The current vertical scroll value.
  500. ----
  501. .. _class_TextEdit_property_selecting_enabled:
  502. - :ref:`bool<class_bool>` **selecting_enabled**
  503. +-----------+------------------------------+
  504. | *Default* | ``true`` |
  505. +-----------+------------------------------+
  506. | *Setter* | set_selecting_enabled(value) |
  507. +-----------+------------------------------+
  508. | *Getter* | is_selecting_enabled() |
  509. +-----------+------------------------------+
  510. ----
  511. .. _class_TextEdit_property_shortcut_keys_enabled:
  512. - :ref:`bool<class_bool>` **shortcut_keys_enabled**
  513. +-----------+----------------------------------+
  514. | *Default* | ``true`` |
  515. +-----------+----------------------------------+
  516. | *Setter* | set_shortcut_keys_enabled(value) |
  517. +-----------+----------------------------------+
  518. | *Getter* | is_shortcut_keys_enabled() |
  519. +-----------+----------------------------------+
  520. ----
  521. .. _class_TextEdit_property_show_line_numbers:
  522. - :ref:`bool<class_bool>` **show_line_numbers**
  523. +-----------+--------------------------------+
  524. | *Default* | ``false`` |
  525. +-----------+--------------------------------+
  526. | *Setter* | set_show_line_numbers(value) |
  527. +-----------+--------------------------------+
  528. | *Getter* | is_show_line_numbers_enabled() |
  529. +-----------+--------------------------------+
  530. If ``true``, line numbers are displayed to the left of the text.
  531. ----
  532. .. _class_TextEdit_property_smooth_scrolling:
  533. - :ref:`bool<class_bool>` **smooth_scrolling**
  534. +-----------+---------------------------------+
  535. | *Default* | ``false`` |
  536. +-----------+---------------------------------+
  537. | *Setter* | set_smooth_scroll_enable(value) |
  538. +-----------+---------------------------------+
  539. | *Getter* | is_smooth_scroll_enabled() |
  540. +-----------+---------------------------------+
  541. If ``true``, sets the ``step`` of the scrollbars to ``0.25`` which results in smoother scrolling.
  542. ----
  543. .. _class_TextEdit_property_syntax_highlighting:
  544. - :ref:`bool<class_bool>` **syntax_highlighting**
  545. +-----------+------------------------------+
  546. | *Default* | ``false`` |
  547. +-----------+------------------------------+
  548. | *Setter* | set_syntax_coloring(value) |
  549. +-----------+------------------------------+
  550. | *Getter* | is_syntax_coloring_enabled() |
  551. +-----------+------------------------------+
  552. If ``true``, any custom color properties that have been set for this ``TextEdit`` will be visible.
  553. ----
  554. .. _class_TextEdit_property_text:
  555. - :ref:`String<class_String>` **text**
  556. +-----------+-----------------+
  557. | *Default* | ``""`` |
  558. +-----------+-----------------+
  559. | *Setter* | set_text(value) |
  560. +-----------+-----------------+
  561. | *Getter* | get_text() |
  562. +-----------+-----------------+
  563. String value of the ``TextEdit``.
  564. ----
  565. .. _class_TextEdit_property_v_scroll_speed:
  566. - :ref:`float<class_float>` **v_scroll_speed**
  567. +-----------+---------------------------+
  568. | *Default* | ``80.0`` |
  569. +-----------+---------------------------+
  570. | *Setter* | set_v_scroll_speed(value) |
  571. +-----------+---------------------------+
  572. | *Getter* | get_v_scroll_speed() |
  573. +-----------+---------------------------+
  574. Vertical scroll sensitivity.
  575. ----
  576. .. _class_TextEdit_property_wrap_enabled:
  577. - :ref:`bool<class_bool>` **wrap_enabled**
  578. +-----------+-------------------------+
  579. | *Default* | ``false`` |
  580. +-----------+-------------------------+
  581. | *Setter* | set_wrap_enabled(value) |
  582. +-----------+-------------------------+
  583. | *Getter* | is_wrap_enabled() |
  584. +-----------+-------------------------+
  585. If ``true``, enables text wrapping when it goes beyond the edge of what is visible.
  586. Method Descriptions
  587. -------------------
  588. .. _class_TextEdit_method_add_color_region:
  589. - 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 **)**
  590. Adds color region (given the delimiters) and its colors.
  591. ----
  592. .. _class_TextEdit_method_add_keyword_color:
  593. - void **add_keyword_color** **(** :ref:`String<class_String>` keyword, :ref:`Color<class_Color>` color **)**
  594. Adds a ``keyword`` and its :ref:`Color<class_Color>`.
  595. ----
  596. .. _class_TextEdit_method_can_fold:
  597. - :ref:`bool<class_bool>` **can_fold** **(** :ref:`int<class_int>` line **)** const
  598. Returns if the given line is foldable, that is, it has indented lines right below it.
  599. ----
  600. .. _class_TextEdit_method_center_viewport_to_cursor:
  601. - void **center_viewport_to_cursor** **(** **)**
  602. ----
  603. .. _class_TextEdit_method_clear_colors:
  604. - void **clear_colors** **(** **)**
  605. 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>`.
  606. ----
  607. .. _class_TextEdit_method_clear_undo_history:
  608. - void **clear_undo_history** **(** **)**
  609. Clears the undo history.
  610. ----
  611. .. _class_TextEdit_method_copy:
  612. - void **copy** **(** **)**
  613. Copy's the current text selection.
  614. ----
  615. .. _class_TextEdit_method_cursor_get_column:
  616. - :ref:`int<class_int>` **cursor_get_column** **(** **)** const
  617. Returns the column the editing cursor is at.
  618. ----
  619. .. _class_TextEdit_method_cursor_get_line:
  620. - :ref:`int<class_int>` **cursor_get_line** **(** **)** const
  621. Returns the line the editing cursor is at.
  622. ----
  623. .. _class_TextEdit_method_cursor_set_column:
  624. - void **cursor_set_column** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)**
  625. Moves the cursor at the specified ``column`` index.
  626. If ``adjust_viewport`` is set to ``true``, the viewport will center at the cursor position after the move occurs.
  627. ----
  628. .. _class_TextEdit_method_cursor_set_line:
  629. - 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 **)**
  630. Moves the cursor at the specified ``line`` index.
  631. If ``adjust_viewport`` is set to ``true``, the viewport will center at the cursor position after the move occurs.
  632. 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>`.
  633. ----
  634. .. _class_TextEdit_method_cut:
  635. - void **cut** **(** **)**
  636. Cut's the current selection.
  637. ----
  638. .. _class_TextEdit_method_deselect:
  639. - void **deselect** **(** **)**
  640. Deselects the current selection.
  641. ----
  642. .. _class_TextEdit_method_fold_all_lines:
  643. - void **fold_all_lines** **(** **)**
  644. Folds all lines that are possible to be folded (see :ref:`can_fold<class_TextEdit_method_can_fold>`).
  645. ----
  646. .. _class_TextEdit_method_fold_line:
  647. - void **fold_line** **(** :ref:`int<class_int>` line **)**
  648. Folds the given line, if possible (see :ref:`can_fold<class_TextEdit_method_can_fold>`).
  649. ----
  650. .. _class_TextEdit_method_get_breakpoints:
  651. - :ref:`Array<class_Array>` **get_breakpoints** **(** **)** const
  652. Returns an array containing the line number of each breakpoint.
  653. ----
  654. .. _class_TextEdit_method_get_keyword_color:
  655. - :ref:`Color<class_Color>` **get_keyword_color** **(** :ref:`String<class_String>` keyword **)** const
  656. Returns the :ref:`Color<class_Color>` of the specified ``keyword``.
  657. ----
  658. .. _class_TextEdit_method_get_line:
  659. - :ref:`String<class_String>` **get_line** **(** :ref:`int<class_int>` line **)** const
  660. Returns the text of a specific line.
  661. ----
  662. .. _class_TextEdit_method_get_line_count:
  663. - :ref:`int<class_int>` **get_line_count** **(** **)** const
  664. Returns the amount of total lines in the text.
  665. ----
  666. .. _class_TextEdit_method_get_menu:
  667. - :ref:`PopupMenu<class_PopupMenu>` **get_menu** **(** **)** const
  668. Returns the :ref:`PopupMenu<class_PopupMenu>` of this ``TextEdit``. By default, this menu is displayed when right-clicking on the ``TextEdit``.
  669. ----
  670. .. _class_TextEdit_method_get_selection_from_column:
  671. - :ref:`int<class_int>` **get_selection_from_column** **(** **)** const
  672. Returns the selection begin column.
  673. ----
  674. .. _class_TextEdit_method_get_selection_from_line:
  675. - :ref:`int<class_int>` **get_selection_from_line** **(** **)** const
  676. Returns the selection begin line.
  677. ----
  678. .. _class_TextEdit_method_get_selection_text:
  679. - :ref:`String<class_String>` **get_selection_text** **(** **)** const
  680. Returns the text inside the selection.
  681. ----
  682. .. _class_TextEdit_method_get_selection_to_column:
  683. - :ref:`int<class_int>` **get_selection_to_column** **(** **)** const
  684. Returns the selection end column.
  685. ----
  686. .. _class_TextEdit_method_get_selection_to_line:
  687. - :ref:`int<class_int>` **get_selection_to_line** **(** **)** const
  688. Returns the selection end line.
  689. ----
  690. .. _class_TextEdit_method_get_word_under_cursor:
  691. - :ref:`String<class_String>` **get_word_under_cursor** **(** **)** const
  692. Returns a :ref:`String<class_String>` text with the word under the mouse cursor location.
  693. ----
  694. .. _class_TextEdit_method_has_keyword_color:
  695. - :ref:`bool<class_bool>` **has_keyword_color** **(** :ref:`String<class_String>` keyword **)** const
  696. Returns whether the specified ``keyword`` has a color set to it or not.
  697. ----
  698. .. _class_TextEdit_method_insert_text_at_cursor:
  699. - void **insert_text_at_cursor** **(** :ref:`String<class_String>` text **)**
  700. Insert the specified text at the cursor position.
  701. ----
  702. .. _class_TextEdit_method_is_folded:
  703. - :ref:`bool<class_bool>` **is_folded** **(** :ref:`int<class_int>` line **)** const
  704. Returns whether the line at the specified index is folded or not.
  705. ----
  706. .. _class_TextEdit_method_is_line_hidden:
  707. - :ref:`bool<class_bool>` **is_line_hidden** **(** :ref:`int<class_int>` line **)** const
  708. Returns whether the line at the specified index is hidden or not.
  709. ----
  710. .. _class_TextEdit_method_is_selection_active:
  711. - :ref:`bool<class_bool>` **is_selection_active** **(** **)** const
  712. Returns ``true`` if the selection is active.
  713. ----
  714. .. _class_TextEdit_method_menu_option:
  715. - void **menu_option** **(** :ref:`int<class_int>` option **)**
  716. Triggers a right-click menu action by the specified index. See :ref:`MenuItems<enum_TextEdit_MenuItems>` for a list of available indexes.
  717. ----
  718. .. _class_TextEdit_method_paste:
  719. - void **paste** **(** **)**
  720. Paste the current selection.
  721. ----
  722. .. _class_TextEdit_method_redo:
  723. - void **redo** **(** **)**
  724. Perform redo operation.
  725. ----
  726. .. _class_TextEdit_method_remove_breakpoints:
  727. - void **remove_breakpoints** **(** **)**
  728. Removes all the breakpoints. This will not fire the :ref:`breakpoint_toggled<class_TextEdit_signal_breakpoint_toggled>` signal.
  729. ----
  730. .. _class_TextEdit_method_search:
  731. - :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
  732. Perform a search inside the text. Search flags can be specified in the :ref:`SearchFlags<enum_TextEdit_SearchFlags>` enum.
  733. 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:
  734. ::
  735. var result = search(key, flags, line, column)
  736. if result.size() > 0:
  737. # Result found.
  738. var res_line = result[TextEdit.SEARCH_RESULT_LINE]
  739. var res_column = result[TextEdit.SEARCH_RESULT_COLUMN]
  740. ----
  741. .. _class_TextEdit_method_select:
  742. - 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 **)**
  743. Perform selection, from line/column to line/column.
  744. ----
  745. .. _class_TextEdit_method_select_all:
  746. - void **select_all** **(** **)**
  747. Select all the text.
  748. ----
  749. .. _class_TextEdit_method_set_line_as_hidden:
  750. - void **set_line_as_hidden** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` enable **)**
  751. If ``true``, hides the line of the specified index.
  752. ----
  753. .. _class_TextEdit_method_toggle_fold_line:
  754. - void **toggle_fold_line** **(** :ref:`int<class_int>` line **)**
  755. Toggle the folding of the code block at the given line.
  756. ----
  757. .. _class_TextEdit_method_undo:
  758. - void **undo** **(** **)**
  759. Perform undo operation.
  760. ----
  761. .. _class_TextEdit_method_unfold_line:
  762. - void **unfold_line** **(** :ref:`int<class_int>` line **)**
  763. Unfolds the given line, if folded.
  764. ----
  765. .. _class_TextEdit_method_unhide_all_lines:
  766. - void **unhide_all_lines** **(** **)**
  767. Unhide all lines that were previously set to hidden by :ref:`set_line_as_hidden<class_TextEdit_method_set_line_as_hidden>`.