class_textedit.rst 201 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/TextEdit.xml.
  6. .. _class_TextEdit:
  7. TextEdit
  8. ========
  9. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`CodeEdit<class_CodeEdit>`
  11. A multiline text editor.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. A multiline text editor. It also has limited facilities for editing code, such as syntax highlighting support. For more advanced facilities for editing code, see :ref:`CodeEdit<class_CodeEdit>`.
  16. \ **Note:** Most viewport, caret and edit methods contain a ``caret_index`` argument for :ref:`caret_multiple<class_TextEdit_property_caret_multiple>` support. The argument should be one of the following: ``-1`` for all carets, ``0`` for the main caret, or greater than ``0`` for secondary carets.
  17. \ **Note:** When holding down :kbd:`Alt`, the vertical scroll wheel will scroll 5 times as fast as it would normally do. This also works in the Godot script editor.
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  24. | :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` | :ref:`autowrap_mode<class_TextEdit_property_autowrap_mode>` | ``3`` |
  25. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`caret_blink<class_TextEdit_property_caret_blink>` | ``false`` |
  27. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`caret_blink_interval<class_TextEdit_property_caret_blink_interval>` | ``0.65`` |
  29. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`caret_draw_when_editable_disabled<class_TextEdit_property_caret_draw_when_editable_disabled>` | ``false`` |
  31. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`caret_mid_grapheme<class_TextEdit_property_caret_mid_grapheme>` | ``false`` |
  33. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  34. | :ref:`bool<class_bool>` | :ref:`caret_move_on_right_click<class_TextEdit_property_caret_move_on_right_click>` | ``true`` |
  35. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  36. | :ref:`bool<class_bool>` | :ref:`caret_multiple<class_TextEdit_property_caret_multiple>` | ``true`` |
  37. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  38. | :ref:`CaretType<enum_TextEdit_CaretType>` | :ref:`caret_type<class_TextEdit_property_caret_type>` | ``0`` |
  39. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  40. | :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_TextEdit_property_context_menu_enabled>` | ``true`` |
  41. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`deselect_on_focus_loss_enabled<class_TextEdit_property_deselect_on_focus_loss_enabled>` | ``true`` |
  43. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  44. | :ref:`bool<class_bool>` | :ref:`drag_and_drop_selection_enabled<class_TextEdit_property_drag_and_drop_selection_enabled>` | ``true`` |
  45. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  46. | :ref:`bool<class_bool>` | :ref:`draw_control_chars<class_TextEdit_property_draw_control_chars>` | ``false`` |
  47. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  48. | :ref:`bool<class_bool>` | :ref:`draw_spaces<class_TextEdit_property_draw_spaces>` | ``false`` |
  49. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  50. | :ref:`bool<class_bool>` | :ref:`draw_tabs<class_TextEdit_property_draw_tabs>` | ``false`` |
  51. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  52. | :ref:`bool<class_bool>` | :ref:`editable<class_TextEdit_property_editable>` | ``true`` |
  53. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  54. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  55. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  56. | :ref:`bool<class_bool>` | :ref:`highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` | ``false`` |
  57. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`highlight_current_line<class_TextEdit_property_highlight_current_line>` | ``false`` |
  59. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  60. | :ref:`String<class_String>` | :ref:`language<class_TextEdit_property_language>` | ``""`` |
  61. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`middle_mouse_paste_enabled<class_TextEdit_property_middle_mouse_paste_enabled>` | ``true`` |
  63. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`minimap_draw<class_TextEdit_property_minimap_draw>` | ``false`` |
  65. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :ref:`minimap_width<class_TextEdit_property_minimap_width>` | ``80`` |
  67. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  68. | :ref:`CursorShape<enum_Control_CursorShape>` | mouse_default_cursor_shape | ``1`` (overrides :ref:`Control<class_Control_property_mouse_default_cursor_shape>`) |
  69. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  70. | :ref:`String<class_String>` | :ref:`placeholder_text<class_TextEdit_property_placeholder_text>` | ``""`` |
  71. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  72. | :ref:`bool<class_bool>` | :ref:`scroll_fit_content_height<class_TextEdit_property_scroll_fit_content_height>` | ``false`` |
  73. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  74. | :ref:`int<class_int>` | :ref:`scroll_horizontal<class_TextEdit_property_scroll_horizontal>` | ``0`` |
  75. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  76. | :ref:`bool<class_bool>` | :ref:`scroll_past_end_of_file<class_TextEdit_property_scroll_past_end_of_file>` | ``false`` |
  77. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  78. | :ref:`bool<class_bool>` | :ref:`scroll_smooth<class_TextEdit_property_scroll_smooth>` | ``false`` |
  79. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  80. | :ref:`float<class_float>` | :ref:`scroll_v_scroll_speed<class_TextEdit_property_scroll_v_scroll_speed>` | ``80.0`` |
  81. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  82. | :ref:`float<class_float>` | :ref:`scroll_vertical<class_TextEdit_property_scroll_vertical>` | ``0.0`` |
  83. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  84. | :ref:`bool<class_bool>` | :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` | ``true`` |
  85. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  86. | :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_TextEdit_property_shortcut_keys_enabled>` | ``true`` |
  87. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  88. | :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_TextEdit_property_structured_text_bidi_override>` | ``0`` |
  89. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  90. | :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_TextEdit_property_structured_text_bidi_override_options>` | ``[]`` |
  91. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  92. | :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` | :ref:`syntax_highlighter<class_TextEdit_property_syntax_highlighter>` | |
  93. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  94. | :ref:`String<class_String>` | :ref:`text<class_TextEdit_property_text>` | ``""`` |
  95. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  96. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_TextEdit_property_text_direction>` | ``0`` |
  97. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  98. | :ref:`bool<class_bool>` | :ref:`virtual_keyboard_enabled<class_TextEdit_property_virtual_keyboard_enabled>` | ``true`` |
  99. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  100. | :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` | :ref:`wrap_mode<class_TextEdit_property_wrap_mode>` | ``0`` |
  101. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  102. .. rst-class:: classref-reftable-group
  103. Methods
  104. -------
  105. .. table::
  106. :widths: auto
  107. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | void | :ref:`_backspace<class_TextEdit_private_method__backspace>` **(** :ref:`int<class_int>` caret_index **)** |virtual| |
  109. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | void | :ref:`_copy<class_TextEdit_private_method__copy>` **(** :ref:`int<class_int>` caret_index **)** |virtual| |
  111. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | void | :ref:`_cut<class_TextEdit_private_method__cut>` **(** :ref:`int<class_int>` caret_index **)** |virtual| |
  113. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | void | :ref:`_handle_unicode_input<class_TextEdit_private_method__handle_unicode_input>` **(** :ref:`int<class_int>` unicode_char, :ref:`int<class_int>` caret_index **)** |virtual| |
  115. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | void | :ref:`_paste<class_TextEdit_private_method__paste>` **(** :ref:`int<class_int>` caret_index **)** |virtual| |
  117. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | void | :ref:`_paste_primary_clipboard<class_TextEdit_private_method__paste_primary_clipboard>` **(** :ref:`int<class_int>` caret_index **)** |virtual| |
  119. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`int<class_int>` | :ref:`add_caret<class_TextEdit_method_add_caret>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` col **)** |
  121. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | void | :ref:`add_caret_at_carets<class_TextEdit_method_add_caret_at_carets>` **(** :ref:`bool<class_bool>` below **)** |
  123. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | void | :ref:`add_gutter<class_TextEdit_method_add_gutter>` **(** :ref:`int<class_int>` at=-1 **)** |
  125. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | void | :ref:`add_selection_for_next_occurrence<class_TextEdit_method_add_selection_for_next_occurrence>` **(** **)** |
  127. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | void | :ref:`adjust_carets_after_edit<class_TextEdit_method_adjust_carets_after_edit>` **(** :ref:`int<class_int>` caret, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_col, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_col **)** |
  129. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | void | :ref:`adjust_viewport_to_caret<class_TextEdit_method_adjust_viewport_to_caret>` **(** :ref:`int<class_int>` caret_index=0 **)** |
  131. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | void | :ref:`backspace<class_TextEdit_method_backspace>` **(** :ref:`int<class_int>` caret_index=-1 **)** |
  133. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`begin_complex_operation<class_TextEdit_method_begin_complex_operation>` **(** **)** |
  135. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | void | :ref:`center_viewport_to_caret<class_TextEdit_method_center_viewport_to_caret>` **(** :ref:`int<class_int>` caret_index=0 **)** |
  137. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`clear<class_TextEdit_method_clear>` **(** **)** |
  139. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | void | :ref:`clear_undo_history<class_TextEdit_method_clear_undo_history>` **(** **)** |
  141. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | void | :ref:`copy<class_TextEdit_method_copy>` **(** :ref:`int<class_int>` caret_index=-1 **)** |
  143. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | void | :ref:`cut<class_TextEdit_method_cut>` **(** :ref:`int<class_int>` caret_index=-1 **)** |
  145. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | void | :ref:`delete_selection<class_TextEdit_method_delete_selection>` **(** :ref:`int<class_int>` caret_index=-1 **)** |
  147. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | void | :ref:`deselect<class_TextEdit_method_deselect>` **(** :ref:`int<class_int>` caret_index=-1 **)** |
  149. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | void | :ref:`end_action<class_TextEdit_method_end_action>` **(** **)** |
  151. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | void | :ref:`end_complex_operation<class_TextEdit_method_end_complex_operation>` **(** **)** |
  153. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | :ref:`int<class_int>` | :ref:`get_caret_column<class_TextEdit_method_get_caret_column>` **(** :ref:`int<class_int>` caret_index=0 **)** |const| |
  155. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | :ref:`int<class_int>` | :ref:`get_caret_count<class_TextEdit_method_get_caret_count>` **(** **)** |const| |
  157. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`Vector2<class_Vector2>` | :ref:`get_caret_draw_pos<class_TextEdit_method_get_caret_draw_pos>` **(** :ref:`int<class_int>` caret_index=0 **)** |const| |
  159. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_caret_index_edit_order<class_TextEdit_method_get_caret_index_edit_order>` **(** **)** |
  161. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`int<class_int>` | :ref:`get_caret_line<class_TextEdit_method_get_caret_line>` **(** :ref:`int<class_int>` caret_index=0 **)** |const| |
  163. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`int<class_int>` | :ref:`get_caret_wrap_index<class_TextEdit_method_get_caret_wrap_index>` **(** :ref:`int<class_int>` caret_index=0 **)** |const| |
  165. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`int<class_int>` | :ref:`get_first_non_whitespace_column<class_TextEdit_method_get_first_non_whitespace_column>` **(** :ref:`int<class_int>` line **)** |const| |
  167. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | :ref:`int<class_int>` | :ref:`get_first_visible_line<class_TextEdit_method_get_first_visible_line>` **(** **)** |const| |
  169. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | :ref:`int<class_int>` | :ref:`get_gutter_count<class_TextEdit_method_get_gutter_count>` **(** **)** |const| |
  171. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | :ref:`String<class_String>` | :ref:`get_gutter_name<class_TextEdit_method_get_gutter_name>` **(** :ref:`int<class_int>` gutter **)** |const| |
  173. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | :ref:`GutterType<enum_TextEdit_GutterType>` | :ref:`get_gutter_type<class_TextEdit_method_get_gutter_type>` **(** :ref:`int<class_int>` gutter **)** |const| |
  175. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | :ref:`int<class_int>` | :ref:`get_gutter_width<class_TextEdit_method_get_gutter_width>` **(** :ref:`int<class_int>` gutter **)** |const| |
  177. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | :ref:`HScrollBar<class_HScrollBar>` | :ref:`get_h_scroll_bar<class_TextEdit_method_get_h_scroll_bar>` **(** **)** |const| |
  179. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`int<class_int>` | :ref:`get_indent_level<class_TextEdit_method_get_indent_level>` **(** :ref:`int<class_int>` line **)** |const| |
  181. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | :ref:`int<class_int>` | :ref:`get_last_full_visible_line<class_TextEdit_method_get_last_full_visible_line>` **(** **)** |const| |
  183. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | :ref:`int<class_int>` | :ref:`get_last_full_visible_line_wrap_index<class_TextEdit_method_get_last_full_visible_line_wrap_index>` **(** **)** |const| |
  185. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | :ref:`int<class_int>` | :ref:`get_last_unhidden_line<class_TextEdit_method_get_last_unhidden_line>` **(** **)** |const| |
  187. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | :ref:`String<class_String>` | :ref:`get_line<class_TextEdit_method_get_line>` **(** :ref:`int<class_int>` line **)** |const| |
  189. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | :ref:`Color<class_Color>` | :ref:`get_line_background_color<class_TextEdit_method_get_line_background_color>` **(** :ref:`int<class_int>` line **)** |const| |
  191. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_line_column_at_pos<class_TextEdit_method_get_line_column_at_pos>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`bool<class_bool>` allow_out_of_bounds=true **)** |const| |
  193. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | :ref:`int<class_int>` | :ref:`get_line_count<class_TextEdit_method_get_line_count>` **(** **)** |const| |
  195. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_line_gutter_icon<class_TextEdit_method_get_line_gutter_icon>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
  197. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | :ref:`Color<class_Color>` | :ref:`get_line_gutter_item_color<class_TextEdit_method_get_line_gutter_item_color>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
  199. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | :ref:`Variant<class_Variant>` | :ref:`get_line_gutter_metadata<class_TextEdit_method_get_line_gutter_metadata>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
  201. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | :ref:`String<class_String>` | :ref:`get_line_gutter_text<class_TextEdit_method_get_line_gutter_text>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
  203. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | :ref:`int<class_int>` | :ref:`get_line_height<class_TextEdit_method_get_line_height>` **(** **)** |const| |
  205. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | :ref:`int<class_int>` | :ref:`get_line_width<class_TextEdit_method_get_line_width>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=-1 **)** |const| |
  207. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | :ref:`int<class_int>` | :ref:`get_line_wrap_count<class_TextEdit_method_get_line_wrap_count>` **(** :ref:`int<class_int>` line **)** |const| |
  209. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | :ref:`int<class_int>` | :ref:`get_line_wrap_index_at_column<class_TextEdit_method_get_line_wrap_index_at_column>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const| |
  211. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_line_wrapped_text<class_TextEdit_method_get_line_wrapped_text>` **(** :ref:`int<class_int>` line **)** |const| |
  213. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | :ref:`Vector2<class_Vector2>` | :ref:`get_local_mouse_pos<class_TextEdit_method_get_local_mouse_pos>` **(** **)** |const| |
  215. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_TextEdit_method_get_menu>` **(** **)** |const| |
  217. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | :ref:`int<class_int>` | :ref:`get_minimap_line_at_pos<class_TextEdit_method_get_minimap_line_at_pos>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
  219. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | :ref:`int<class_int>` | :ref:`get_minimap_visible_lines<class_TextEdit_method_get_minimap_visible_lines>` **(** **)** |const| |
  221. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_next_visible_line_index_offset_from<class_TextEdit_method_get_next_visible_line_index_offset_from>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index, :ref:`int<class_int>` visible_amount **)** |const| |
  223. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | :ref:`int<class_int>` | :ref:`get_next_visible_line_offset_from<class_TextEdit_method_get_next_visible_line_offset_from>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` visible_amount **)** |const| |
  225. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_pos_at_line_column<class_TextEdit_method_get_pos_at_line_column>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const| |
  227. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | :ref:`Rect2i<class_Rect2i>` | :ref:`get_rect_at_line_column<class_TextEdit_method_get_rect_at_line_column>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const| |
  229. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | :ref:`int<class_int>` | :ref:`get_saved_version<class_TextEdit_method_get_saved_version>` **(** **)** |const| |
  231. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | :ref:`float<class_float>` | :ref:`get_scroll_pos_for_line<class_TextEdit_method_get_scroll_pos_for_line>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |const| |
  233. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | :ref:`String<class_String>` | :ref:`get_selected_text<class_TextEdit_method_get_selected_text>` **(** :ref:`int<class_int>` caret_index=-1 **)** |
  235. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | :ref:`int<class_int>` | :ref:`get_selection_column<class_TextEdit_method_get_selection_column>` **(** :ref:`int<class_int>` caret_index=0 **)** |const| |
  237. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | :ref:`int<class_int>` | :ref:`get_selection_from_column<class_TextEdit_method_get_selection_from_column>` **(** :ref:`int<class_int>` caret_index=0 **)** |const| |
  239. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | :ref:`int<class_int>` | :ref:`get_selection_from_line<class_TextEdit_method_get_selection_from_line>` **(** :ref:`int<class_int>` caret_index=0 **)** |const| |
  241. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | :ref:`int<class_int>` | :ref:`get_selection_line<class_TextEdit_method_get_selection_line>` **(** :ref:`int<class_int>` caret_index=0 **)** |const| |
  243. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | :ref:`SelectionMode<enum_TextEdit_SelectionMode>` | :ref:`get_selection_mode<class_TextEdit_method_get_selection_mode>` **(** **)** |const| |
  245. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | :ref:`int<class_int>` | :ref:`get_selection_to_column<class_TextEdit_method_get_selection_to_column>` **(** :ref:`int<class_int>` caret_index=0 **)** |const| |
  247. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. | :ref:`int<class_int>` | :ref:`get_selection_to_line<class_TextEdit_method_get_selection_to_line>` **(** :ref:`int<class_int>` caret_index=0 **)** |const| |
  249. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  250. | :ref:`int<class_int>` | :ref:`get_tab_size<class_TextEdit_method_get_tab_size>` **(** **)** |const| |
  251. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  252. | :ref:`int<class_int>` | :ref:`get_total_gutter_width<class_TextEdit_method_get_total_gutter_width>` **(** **)** |const| |
  253. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  254. | :ref:`int<class_int>` | :ref:`get_total_visible_line_count<class_TextEdit_method_get_total_visible_line_count>` **(** **)** |const| |
  255. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  256. | :ref:`VScrollBar<class_VScrollBar>` | :ref:`get_v_scroll_bar<class_TextEdit_method_get_v_scroll_bar>` **(** **)** |const| |
  257. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  258. | :ref:`int<class_int>` | :ref:`get_version<class_TextEdit_method_get_version>` **(** **)** |const| |
  259. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  260. | :ref:`int<class_int>` | :ref:`get_visible_line_count<class_TextEdit_method_get_visible_line_count>` **(** **)** |const| |
  261. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  262. | :ref:`int<class_int>` | :ref:`get_visible_line_count_in_range<class_TextEdit_method_get_visible_line_count_in_range>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)** |const| |
  263. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  264. | :ref:`String<class_String>` | :ref:`get_word_at_pos<class_TextEdit_method_get_word_at_pos>` **(** :ref:`Vector2<class_Vector2>` position **)** |const| |
  265. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  266. | :ref:`String<class_String>` | :ref:`get_word_under_caret<class_TextEdit_method_get_word_under_caret>` **(** :ref:`int<class_int>` caret_index=-1 **)** |const| |
  267. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  268. | :ref:`bool<class_bool>` | :ref:`has_ime_text<class_TextEdit_method_has_ime_text>` **(** **)** |const| |
  269. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  270. | :ref:`bool<class_bool>` | :ref:`has_redo<class_TextEdit_method_has_redo>` **(** **)** |const| |
  271. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  272. | :ref:`bool<class_bool>` | :ref:`has_selection<class_TextEdit_method_has_selection>` **(** :ref:`int<class_int>` caret_index=-1 **)** |const| |
  273. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  274. | :ref:`bool<class_bool>` | :ref:`has_undo<class_TextEdit_method_has_undo>` **(** **)** |const| |
  275. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  276. | void | :ref:`insert_line_at<class_TextEdit_method_insert_line_at>` **(** :ref:`int<class_int>` line, :ref:`String<class_String>` text **)** |
  277. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  278. | void | :ref:`insert_text_at_caret<class_TextEdit_method_insert_text_at_caret>` **(** :ref:`String<class_String>` text, :ref:`int<class_int>` caret_index=-1 **)** |
  279. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  280. | :ref:`bool<class_bool>` | :ref:`is_caret_visible<class_TextEdit_method_is_caret_visible>` **(** :ref:`int<class_int>` caret_index=0 **)** |const| |
  281. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  282. | :ref:`bool<class_bool>` | :ref:`is_dragging_cursor<class_TextEdit_method_is_dragging_cursor>` **(** **)** |const| |
  283. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  284. | :ref:`bool<class_bool>` | :ref:`is_gutter_clickable<class_TextEdit_method_is_gutter_clickable>` **(** :ref:`int<class_int>` gutter **)** |const| |
  285. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  286. | :ref:`bool<class_bool>` | :ref:`is_gutter_drawn<class_TextEdit_method_is_gutter_drawn>` **(** :ref:`int<class_int>` gutter **)** |const| |
  287. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  288. | :ref:`bool<class_bool>` | :ref:`is_gutter_overwritable<class_TextEdit_method_is_gutter_overwritable>` **(** :ref:`int<class_int>` gutter **)** |const| |
  289. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  290. | :ref:`bool<class_bool>` | :ref:`is_line_gutter_clickable<class_TextEdit_method_is_line_gutter_clickable>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
  291. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  292. | :ref:`bool<class_bool>` | :ref:`is_line_wrapped<class_TextEdit_method_is_line_wrapped>` **(** :ref:`int<class_int>` line **)** |const| |
  293. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  294. | :ref:`bool<class_bool>` | :ref:`is_menu_visible<class_TextEdit_method_is_menu_visible>` **(** **)** |const| |
  295. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  296. | :ref:`bool<class_bool>` | :ref:`is_mouse_over_selection<class_TextEdit_method_is_mouse_over_selection>` **(** :ref:`bool<class_bool>` edges, :ref:`int<class_int>` caret_index=-1 **)** |const| |
  297. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  298. | :ref:`bool<class_bool>` | :ref:`is_overtype_mode_enabled<class_TextEdit_method_is_overtype_mode_enabled>` **(** **)** |const| |
  299. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  300. | void | :ref:`menu_option<class_TextEdit_method_menu_option>` **(** :ref:`int<class_int>` option **)** |
  301. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  302. | void | :ref:`merge_gutters<class_TextEdit_method_merge_gutters>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)** |
  303. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  304. | void | :ref:`merge_overlapping_carets<class_TextEdit_method_merge_overlapping_carets>` **(** **)** |
  305. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  306. | void | :ref:`paste<class_TextEdit_method_paste>` **(** :ref:`int<class_int>` caret_index=-1 **)** |
  307. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  308. | void | :ref:`paste_primary_clipboard<class_TextEdit_method_paste_primary_clipboard>` **(** :ref:`int<class_int>` caret_index=-1 **)** |
  309. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  310. | void | :ref:`redo<class_TextEdit_method_redo>` **(** **)** |
  311. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  312. | void | :ref:`remove_caret<class_TextEdit_method_remove_caret>` **(** :ref:`int<class_int>` caret **)** |
  313. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  314. | void | :ref:`remove_gutter<class_TextEdit_method_remove_gutter>` **(** :ref:`int<class_int>` gutter **)** |
  315. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  316. | void | :ref:`remove_secondary_carets<class_TextEdit_method_remove_secondary_carets>` **(** **)** |
  317. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  318. | void | :ref:`remove_text<class_TextEdit_method_remove_text>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_column **)** |
  319. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  320. | :ref:`Vector2i<class_Vector2i>` | :ref:`search<class_TextEdit_method_search>` **(** :ref:`String<class_String>` text, :ref:`int<class_int>` flags, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_colum **)** |const| |
  321. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  322. | 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, :ref:`int<class_int>` caret_index=0 **)** |
  323. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  324. | void | :ref:`select_all<class_TextEdit_method_select_all>` **(** **)** |
  325. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  326. | void | :ref:`select_word_under_caret<class_TextEdit_method_select_word_under_caret>` **(** :ref:`int<class_int>` caret_index=-1 **)** |
  327. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  328. | void | :ref:`set_caret_column<class_TextEdit_method_set_caret_column>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true, :ref:`int<class_int>` caret_index=0 **)** |
  329. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  330. | void | :ref:`set_caret_line<class_TextEdit_method_set_caret_line>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` adjust_viewport=true, :ref:`bool<class_bool>` can_be_hidden=true, :ref:`int<class_int>` wrap_index=0, :ref:`int<class_int>` caret_index=0 **)** |
  331. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  332. | void | :ref:`set_gutter_clickable<class_TextEdit_method_set_gutter_clickable>` **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` clickable **)** |
  333. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  334. | void | :ref:`set_gutter_custom_draw<class_TextEdit_method_set_gutter_custom_draw>` **(** :ref:`int<class_int>` column, :ref:`Callable<class_Callable>` draw_callback **)** |
  335. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  336. | void | :ref:`set_gutter_draw<class_TextEdit_method_set_gutter_draw>` **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` draw **)** |
  337. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  338. | void | :ref:`set_gutter_name<class_TextEdit_method_set_gutter_name>` **(** :ref:`int<class_int>` gutter, :ref:`String<class_String>` name **)** |
  339. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  340. | void | :ref:`set_gutter_overwritable<class_TextEdit_method_set_gutter_overwritable>` **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` overwritable **)** |
  341. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  342. | void | :ref:`set_gutter_type<class_TextEdit_method_set_gutter_type>` **(** :ref:`int<class_int>` gutter, :ref:`GutterType<enum_TextEdit_GutterType>` type **)** |
  343. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  344. | void | :ref:`set_gutter_width<class_TextEdit_method_set_gutter_width>` **(** :ref:`int<class_int>` gutter, :ref:`int<class_int>` width **)** |
  345. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  346. | void | :ref:`set_line<class_TextEdit_method_set_line>` **(** :ref:`int<class_int>` line, :ref:`String<class_String>` new_text **)** |
  347. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  348. | void | :ref:`set_line_as_center_visible<class_TextEdit_method_set_line_as_center_visible>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |
  349. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  350. | void | :ref:`set_line_as_first_visible<class_TextEdit_method_set_line_as_first_visible>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |
  351. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  352. | void | :ref:`set_line_as_last_visible<class_TextEdit_method_set_line_as_last_visible>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |
  353. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  354. | void | :ref:`set_line_background_color<class_TextEdit_method_set_line_background_color>` **(** :ref:`int<class_int>` line, :ref:`Color<class_Color>` color **)** |
  355. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  356. | void | :ref:`set_line_gutter_clickable<class_TextEdit_method_set_line_gutter_clickable>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` clickable **)** |
  357. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  358. | void | :ref:`set_line_gutter_icon<class_TextEdit_method_set_line_gutter_icon>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Texture2D<class_Texture2D>` icon **)** |
  359. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  360. | void | :ref:`set_line_gutter_item_color<class_TextEdit_method_set_line_gutter_item_color>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Color<class_Color>` color **)** |
  361. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  362. | void | :ref:`set_line_gutter_metadata<class_TextEdit_method_set_line_gutter_metadata>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Variant<class_Variant>` metadata **)** |
  363. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  364. | void | :ref:`set_line_gutter_text<class_TextEdit_method_set_line_gutter_text>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`String<class_String>` text **)** |
  365. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  366. | void | :ref:`set_overtype_mode_enabled<class_TextEdit_method_set_overtype_mode_enabled>` **(** :ref:`bool<class_bool>` enabled **)** |
  367. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  368. | void | :ref:`set_search_flags<class_TextEdit_method_set_search_flags>` **(** :ref:`int<class_int>` flags **)** |
  369. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  370. | void | :ref:`set_search_text<class_TextEdit_method_set_search_text>` **(** :ref:`String<class_String>` search_text **)** |
  371. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  372. | void | :ref:`set_selection_mode<class_TextEdit_method_set_selection_mode>` **(** :ref:`SelectionMode<enum_TextEdit_SelectionMode>` mode, :ref:`int<class_int>` line=-1, :ref:`int<class_int>` column=-1, :ref:`int<class_int>` caret_index=0 **)** |
  373. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  374. | void | :ref:`set_tab_size<class_TextEdit_method_set_tab_size>` **(** :ref:`int<class_int>` size **)** |
  375. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  376. | void | :ref:`set_tooltip_request_func<class_TextEdit_method_set_tooltip_request_func>` **(** :ref:`Callable<class_Callable>` callback **)** |
  377. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  378. | void | :ref:`start_action<class_TextEdit_method_start_action>` **(** :ref:`EditAction<enum_TextEdit_EditAction>` action **)** |
  379. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  380. | void | :ref:`swap_lines<class_TextEdit_method_swap_lines>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)** |
  381. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  382. | void | :ref:`tag_saved_version<class_TextEdit_method_tag_saved_version>` **(** **)** |
  383. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  384. | void | :ref:`undo<class_TextEdit_method_undo>` **(** **)** |
  385. +---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  386. .. rst-class:: classref-reftable-group
  387. Theme Properties
  388. ----------------
  389. .. table::
  390. :widths: auto
  391. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  392. | :ref:`Color<class_Color>` | :ref:`background_color<class_TextEdit_theme_color_background_color>` | ``Color(0, 0, 0, 0)`` |
  393. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  394. | :ref:`Color<class_Color>` | :ref:`caret_background_color<class_TextEdit_theme_color_caret_background_color>` | ``Color(0, 0, 0, 1)`` |
  395. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  396. | :ref:`Color<class_Color>` | :ref:`caret_color<class_TextEdit_theme_color_caret_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  397. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  398. | :ref:`Color<class_Color>` | :ref:`current_line_color<class_TextEdit_theme_color_current_line_color>` | ``Color(0.25, 0.25, 0.26, 0.8)`` |
  399. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  400. | :ref:`Color<class_Color>` | :ref:`font_color<class_TextEdit_theme_color_font_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  401. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  402. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_TextEdit_theme_color_font_outline_color>` | ``Color(1, 1, 1, 1)`` |
  403. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  404. | :ref:`Color<class_Color>` | :ref:`font_placeholder_color<class_TextEdit_theme_color_font_placeholder_color>` | ``Color(0.875, 0.875, 0.875, 0.6)`` |
  405. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  406. | :ref:`Color<class_Color>` | :ref:`font_readonly_color<class_TextEdit_theme_color_font_readonly_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  407. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  408. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_TextEdit_theme_color_font_selected_color>` | ``Color(0, 0, 0, 0)`` |
  409. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  410. | :ref:`Color<class_Color>` | :ref:`search_result_border_color<class_TextEdit_theme_color_search_result_border_color>` | ``Color(0.3, 0.3, 0.3, 0.4)`` |
  411. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  412. | :ref:`Color<class_Color>` | :ref:`search_result_color<class_TextEdit_theme_color_search_result_color>` | ``Color(0.3, 0.3, 0.3, 1)`` |
  413. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  414. | :ref:`Color<class_Color>` | :ref:`selection_color<class_TextEdit_theme_color_selection_color>` | ``Color(0.5, 0.5, 0.5, 1)`` |
  415. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  416. | :ref:`Color<class_Color>` | :ref:`word_highlighted_color<class_TextEdit_theme_color_word_highlighted_color>` | ``Color(0.5, 0.5, 0.5, 0.25)`` |
  417. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  418. | :ref:`int<class_int>` | :ref:`caret_width<class_TextEdit_theme_constant_caret_width>` | ``1`` |
  419. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  420. | :ref:`int<class_int>` | :ref:`line_spacing<class_TextEdit_theme_constant_line_spacing>` | ``4`` |
  421. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  422. | :ref:`int<class_int>` | :ref:`outline_size<class_TextEdit_theme_constant_outline_size>` | ``0`` |
  423. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  424. | :ref:`Font<class_Font>` | :ref:`font<class_TextEdit_theme_font_font>` | |
  425. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  426. | :ref:`int<class_int>` | :ref:`font_size<class_TextEdit_theme_font_size_font_size>` | |
  427. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  428. | :ref:`Texture2D<class_Texture2D>` | :ref:`space<class_TextEdit_theme_icon_space>` | |
  429. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  430. | :ref:`Texture2D<class_Texture2D>` | :ref:`tab<class_TextEdit_theme_icon_tab>` | |
  431. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  432. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_TextEdit_theme_style_focus>` | |
  433. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  434. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_TextEdit_theme_style_normal>` | |
  435. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  436. | :ref:`StyleBox<class_StyleBox>` | :ref:`read_only<class_TextEdit_theme_style_read_only>` | |
  437. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  438. .. rst-class:: classref-section-separator
  439. ----
  440. .. rst-class:: classref-descriptions-group
  441. Signals
  442. -------
  443. .. _class_TextEdit_signal_caret_changed:
  444. .. rst-class:: classref-signal
  445. **caret_changed** **(** **)**
  446. Emitted when the caret changes position.
  447. .. rst-class:: classref-item-separator
  448. ----
  449. .. _class_TextEdit_signal_gutter_added:
  450. .. rst-class:: classref-signal
  451. **gutter_added** **(** **)**
  452. Emitted when a gutter is added.
  453. .. rst-class:: classref-item-separator
  454. ----
  455. .. _class_TextEdit_signal_gutter_clicked:
  456. .. rst-class:: classref-signal
  457. **gutter_clicked** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)**
  458. Emitted when a gutter is clicked.
  459. .. rst-class:: classref-item-separator
  460. ----
  461. .. _class_TextEdit_signal_gutter_removed:
  462. .. rst-class:: classref-signal
  463. **gutter_removed** **(** **)**
  464. Emitted when a gutter is removed.
  465. .. rst-class:: classref-item-separator
  466. ----
  467. .. _class_TextEdit_signal_lines_edited_from:
  468. .. rst-class:: classref-signal
  469. **lines_edited_from** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)**
  470. Emitted immediately when the text changes.
  471. When text is added ``from_line`` will be less than ``to_line``. On a remove ``to_line`` will be less than ``from_line``.
  472. .. rst-class:: classref-item-separator
  473. ----
  474. .. _class_TextEdit_signal_text_changed:
  475. .. rst-class:: classref-signal
  476. **text_changed** **(** **)**
  477. Emitted when the text changes.
  478. .. rst-class:: classref-item-separator
  479. ----
  480. .. _class_TextEdit_signal_text_set:
  481. .. rst-class:: classref-signal
  482. **text_set** **(** **)**
  483. Emitted when :ref:`clear<class_TextEdit_method_clear>` is called or :ref:`text<class_TextEdit_property_text>` is set.
  484. .. rst-class:: classref-section-separator
  485. ----
  486. .. rst-class:: classref-descriptions-group
  487. Enumerations
  488. ------------
  489. .. _enum_TextEdit_MenuItems:
  490. .. rst-class:: classref-enumeration
  491. enum **MenuItems**:
  492. .. _class_TextEdit_constant_MENU_CUT:
  493. .. rst-class:: classref-enumeration-constant
  494. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_CUT** = ``0``
  495. Cuts (copies and clears) the selected text.
  496. .. _class_TextEdit_constant_MENU_COPY:
  497. .. rst-class:: classref-enumeration-constant
  498. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_COPY** = ``1``
  499. Copies the selected text.
  500. .. _class_TextEdit_constant_MENU_PASTE:
  501. .. rst-class:: classref-enumeration-constant
  502. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_PASTE** = ``2``
  503. Pastes the clipboard text over the selected text (or at the cursor's position).
  504. .. _class_TextEdit_constant_MENU_CLEAR:
  505. .. rst-class:: classref-enumeration-constant
  506. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_CLEAR** = ``3``
  507. Erases the whole **TextEdit** text.
  508. .. _class_TextEdit_constant_MENU_SELECT_ALL:
  509. .. rst-class:: classref-enumeration-constant
  510. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_SELECT_ALL** = ``4``
  511. Selects the whole **TextEdit** text.
  512. .. _class_TextEdit_constant_MENU_UNDO:
  513. .. rst-class:: classref-enumeration-constant
  514. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_UNDO** = ``5``
  515. Undoes the previous action.
  516. .. _class_TextEdit_constant_MENU_REDO:
  517. .. rst-class:: classref-enumeration-constant
  518. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_REDO** = ``6``
  519. Redoes the previous action.
  520. .. _class_TextEdit_constant_MENU_SUBMENU_TEXT_DIR:
  521. .. rst-class:: classref-enumeration-constant
  522. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_SUBMENU_TEXT_DIR** = ``7``
  523. ID of "Text Writing Direction" submenu.
  524. .. _class_TextEdit_constant_MENU_DIR_INHERITED:
  525. .. rst-class:: classref-enumeration-constant
  526. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_DIR_INHERITED** = ``8``
  527. Sets text direction to inherited.
  528. .. _class_TextEdit_constant_MENU_DIR_AUTO:
  529. .. rst-class:: classref-enumeration-constant
  530. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_DIR_AUTO** = ``9``
  531. Sets text direction to automatic.
  532. .. _class_TextEdit_constant_MENU_DIR_LTR:
  533. .. rst-class:: classref-enumeration-constant
  534. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_DIR_LTR** = ``10``
  535. Sets text direction to left-to-right.
  536. .. _class_TextEdit_constant_MENU_DIR_RTL:
  537. .. rst-class:: classref-enumeration-constant
  538. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_DIR_RTL** = ``11``
  539. Sets text direction to right-to-left.
  540. .. _class_TextEdit_constant_MENU_DISPLAY_UCC:
  541. .. rst-class:: classref-enumeration-constant
  542. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_DISPLAY_UCC** = ``12``
  543. Toggles control character display.
  544. .. _class_TextEdit_constant_MENU_SUBMENU_INSERT_UCC:
  545. .. rst-class:: classref-enumeration-constant
  546. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_SUBMENU_INSERT_UCC** = ``13``
  547. ID of "Insert Control Character" submenu.
  548. .. _class_TextEdit_constant_MENU_INSERT_LRM:
  549. .. rst-class:: classref-enumeration-constant
  550. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_LRM** = ``14``
  551. Inserts left-to-right mark (LRM) character.
  552. .. _class_TextEdit_constant_MENU_INSERT_RLM:
  553. .. rst-class:: classref-enumeration-constant
  554. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_RLM** = ``15``
  555. Inserts right-to-left mark (RLM) character.
  556. .. _class_TextEdit_constant_MENU_INSERT_LRE:
  557. .. rst-class:: classref-enumeration-constant
  558. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_LRE** = ``16``
  559. Inserts start of left-to-right embedding (LRE) character.
  560. .. _class_TextEdit_constant_MENU_INSERT_RLE:
  561. .. rst-class:: classref-enumeration-constant
  562. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_RLE** = ``17``
  563. Inserts start of right-to-left embedding (RLE) character.
  564. .. _class_TextEdit_constant_MENU_INSERT_LRO:
  565. .. rst-class:: classref-enumeration-constant
  566. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_LRO** = ``18``
  567. Inserts start of left-to-right override (LRO) character.
  568. .. _class_TextEdit_constant_MENU_INSERT_RLO:
  569. .. rst-class:: classref-enumeration-constant
  570. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_RLO** = ``19``
  571. Inserts start of right-to-left override (RLO) character.
  572. .. _class_TextEdit_constant_MENU_INSERT_PDF:
  573. .. rst-class:: classref-enumeration-constant
  574. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_PDF** = ``20``
  575. Inserts pop direction formatting (PDF) character.
  576. .. _class_TextEdit_constant_MENU_INSERT_ALM:
  577. .. rst-class:: classref-enumeration-constant
  578. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_ALM** = ``21``
  579. Inserts Arabic letter mark (ALM) character.
  580. .. _class_TextEdit_constant_MENU_INSERT_LRI:
  581. .. rst-class:: classref-enumeration-constant
  582. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_LRI** = ``22``
  583. Inserts left-to-right isolate (LRI) character.
  584. .. _class_TextEdit_constant_MENU_INSERT_RLI:
  585. .. rst-class:: classref-enumeration-constant
  586. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_RLI** = ``23``
  587. Inserts right-to-left isolate (RLI) character.
  588. .. _class_TextEdit_constant_MENU_INSERT_FSI:
  589. .. rst-class:: classref-enumeration-constant
  590. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_FSI** = ``24``
  591. Inserts first strong isolate (FSI) character.
  592. .. _class_TextEdit_constant_MENU_INSERT_PDI:
  593. .. rst-class:: classref-enumeration-constant
  594. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_PDI** = ``25``
  595. Inserts pop direction isolate (PDI) character.
  596. .. _class_TextEdit_constant_MENU_INSERT_ZWJ:
  597. .. rst-class:: classref-enumeration-constant
  598. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_ZWJ** = ``26``
  599. Inserts zero width joiner (ZWJ) character.
  600. .. _class_TextEdit_constant_MENU_INSERT_ZWNJ:
  601. .. rst-class:: classref-enumeration-constant
  602. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_ZWNJ** = ``27``
  603. Inserts zero width non-joiner (ZWNJ) character.
  604. .. _class_TextEdit_constant_MENU_INSERT_WJ:
  605. .. rst-class:: classref-enumeration-constant
  606. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_WJ** = ``28``
  607. Inserts word joiner (WJ) character.
  608. .. _class_TextEdit_constant_MENU_INSERT_SHY:
  609. .. rst-class:: classref-enumeration-constant
  610. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_SHY** = ``29``
  611. Inserts soft hyphen (SHY) character.
  612. .. _class_TextEdit_constant_MENU_MAX:
  613. .. rst-class:: classref-enumeration-constant
  614. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_MAX** = ``30``
  615. Represents the size of the :ref:`MenuItems<enum_TextEdit_MenuItems>` enum.
  616. .. rst-class:: classref-item-separator
  617. ----
  618. .. _enum_TextEdit_EditAction:
  619. .. rst-class:: classref-enumeration
  620. enum **EditAction**:
  621. .. _class_TextEdit_constant_ACTION_NONE:
  622. .. rst-class:: classref-enumeration-constant
  623. :ref:`EditAction<enum_TextEdit_EditAction>` **ACTION_NONE** = ``0``
  624. No current action.
  625. .. _class_TextEdit_constant_ACTION_TYPING:
  626. .. rst-class:: classref-enumeration-constant
  627. :ref:`EditAction<enum_TextEdit_EditAction>` **ACTION_TYPING** = ``1``
  628. A typing action.
  629. .. _class_TextEdit_constant_ACTION_BACKSPACE:
  630. .. rst-class:: classref-enumeration-constant
  631. :ref:`EditAction<enum_TextEdit_EditAction>` **ACTION_BACKSPACE** = ``2``
  632. A backwards delete action.
  633. .. _class_TextEdit_constant_ACTION_DELETE:
  634. .. rst-class:: classref-enumeration-constant
  635. :ref:`EditAction<enum_TextEdit_EditAction>` **ACTION_DELETE** = ``3``
  636. A forward delete action.
  637. .. rst-class:: classref-item-separator
  638. ----
  639. .. _enum_TextEdit_SearchFlags:
  640. .. rst-class:: classref-enumeration
  641. enum **SearchFlags**:
  642. .. _class_TextEdit_constant_SEARCH_MATCH_CASE:
  643. .. rst-class:: classref-enumeration-constant
  644. :ref:`SearchFlags<enum_TextEdit_SearchFlags>` **SEARCH_MATCH_CASE** = ``1``
  645. Match case when searching.
  646. .. _class_TextEdit_constant_SEARCH_WHOLE_WORDS:
  647. .. rst-class:: classref-enumeration-constant
  648. :ref:`SearchFlags<enum_TextEdit_SearchFlags>` **SEARCH_WHOLE_WORDS** = ``2``
  649. Match whole words when searching.
  650. .. _class_TextEdit_constant_SEARCH_BACKWARDS:
  651. .. rst-class:: classref-enumeration-constant
  652. :ref:`SearchFlags<enum_TextEdit_SearchFlags>` **SEARCH_BACKWARDS** = ``4``
  653. Search from end to beginning.
  654. .. rst-class:: classref-item-separator
  655. ----
  656. .. _enum_TextEdit_CaretType:
  657. .. rst-class:: classref-enumeration
  658. enum **CaretType**:
  659. .. _class_TextEdit_constant_CARET_TYPE_LINE:
  660. .. rst-class:: classref-enumeration-constant
  661. :ref:`CaretType<enum_TextEdit_CaretType>` **CARET_TYPE_LINE** = ``0``
  662. Vertical line caret.
  663. .. _class_TextEdit_constant_CARET_TYPE_BLOCK:
  664. .. rst-class:: classref-enumeration-constant
  665. :ref:`CaretType<enum_TextEdit_CaretType>` **CARET_TYPE_BLOCK** = ``1``
  666. Block caret.
  667. .. rst-class:: classref-item-separator
  668. ----
  669. .. _enum_TextEdit_SelectionMode:
  670. .. rst-class:: classref-enumeration
  671. enum **SelectionMode**:
  672. .. _class_TextEdit_constant_SELECTION_MODE_NONE:
  673. .. rst-class:: classref-enumeration-constant
  674. :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **SELECTION_MODE_NONE** = ``0``
  675. Not selecting.
  676. .. _class_TextEdit_constant_SELECTION_MODE_SHIFT:
  677. .. rst-class:: classref-enumeration-constant
  678. :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **SELECTION_MODE_SHIFT** = ``1``
  679. Select as if ``shift`` is pressed.
  680. .. _class_TextEdit_constant_SELECTION_MODE_POINTER:
  681. .. rst-class:: classref-enumeration-constant
  682. :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **SELECTION_MODE_POINTER** = ``2``
  683. Select single characters as if the user single clicked.
  684. .. _class_TextEdit_constant_SELECTION_MODE_WORD:
  685. .. rst-class:: classref-enumeration-constant
  686. :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **SELECTION_MODE_WORD** = ``3``
  687. Select whole words as if the user double clicked.
  688. .. _class_TextEdit_constant_SELECTION_MODE_LINE:
  689. .. rst-class:: classref-enumeration-constant
  690. :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **SELECTION_MODE_LINE** = ``4``
  691. Select whole lines as if the user triple clicked.
  692. .. rst-class:: classref-item-separator
  693. ----
  694. .. _enum_TextEdit_LineWrappingMode:
  695. .. rst-class:: classref-enumeration
  696. enum **LineWrappingMode**:
  697. .. _class_TextEdit_constant_LINE_WRAPPING_NONE:
  698. .. rst-class:: classref-enumeration-constant
  699. :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` **LINE_WRAPPING_NONE** = ``0``
  700. Line wrapping is disabled.
  701. .. _class_TextEdit_constant_LINE_WRAPPING_BOUNDARY:
  702. .. rst-class:: classref-enumeration-constant
  703. :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` **LINE_WRAPPING_BOUNDARY** = ``1``
  704. Line wrapping occurs at the control boundary, beyond what would normally be visible.
  705. .. rst-class:: classref-item-separator
  706. ----
  707. .. _enum_TextEdit_GutterType:
  708. .. rst-class:: classref-enumeration
  709. enum **GutterType**:
  710. .. _class_TextEdit_constant_GUTTER_TYPE_STRING:
  711. .. rst-class:: classref-enumeration-constant
  712. :ref:`GutterType<enum_TextEdit_GutterType>` **GUTTER_TYPE_STRING** = ``0``
  713. Draw a string.
  714. .. _class_TextEdit_constant_GUTTER_TYPE_ICON:
  715. .. rst-class:: classref-enumeration-constant
  716. :ref:`GutterType<enum_TextEdit_GutterType>` **GUTTER_TYPE_ICON** = ``1``
  717. Draw an icon.
  718. .. _class_TextEdit_constant_GUTTER_TYPE_CUSTOM:
  719. .. rst-class:: classref-enumeration-constant
  720. :ref:`GutterType<enum_TextEdit_GutterType>` **GUTTER_TYPE_CUSTOM** = ``2``
  721. Custom draw.
  722. .. rst-class:: classref-section-separator
  723. ----
  724. .. rst-class:: classref-descriptions-group
  725. Property Descriptions
  726. ---------------------
  727. .. _class_TextEdit_property_autowrap_mode:
  728. .. rst-class:: classref-property
  729. :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **autowrap_mode** = ``3``
  730. .. rst-class:: classref-property-setget
  731. - void **set_autowrap_mode** **(** :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` value **)**
  732. - :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **get_autowrap_mode** **(** **)**
  733. If :ref:`wrap_mode<class_TextEdit_property_wrap_mode>` is set to :ref:`LINE_WRAPPING_BOUNDARY<class_TextEdit_constant_LINE_WRAPPING_BOUNDARY>`, sets text wrapping mode. To see how each mode behaves, see :ref:`AutowrapMode<enum_TextServer_AutowrapMode>`.
  734. .. rst-class:: classref-item-separator
  735. ----
  736. .. _class_TextEdit_property_caret_blink:
  737. .. rst-class:: classref-property
  738. :ref:`bool<class_bool>` **caret_blink** = ``false``
  739. .. rst-class:: classref-property-setget
  740. - void **set_caret_blink_enabled** **(** :ref:`bool<class_bool>` value **)**
  741. - :ref:`bool<class_bool>` **is_caret_blink_enabled** **(** **)**
  742. If ``true``, makes the caret blink.
  743. .. rst-class:: classref-item-separator
  744. ----
  745. .. _class_TextEdit_property_caret_blink_interval:
  746. .. rst-class:: classref-property
  747. :ref:`float<class_float>` **caret_blink_interval** = ``0.65``
  748. .. rst-class:: classref-property-setget
  749. - void **set_caret_blink_interval** **(** :ref:`float<class_float>` value **)**
  750. - :ref:`float<class_float>` **get_caret_blink_interval** **(** **)**
  751. The interval at which the caret blinks (in seconds).
  752. .. rst-class:: classref-item-separator
  753. ----
  754. .. _class_TextEdit_property_caret_draw_when_editable_disabled:
  755. .. rst-class:: classref-property
  756. :ref:`bool<class_bool>` **caret_draw_when_editable_disabled** = ``false``
  757. .. rst-class:: classref-property-setget
  758. - void **set_draw_caret_when_editable_disabled** **(** :ref:`bool<class_bool>` value **)**
  759. - :ref:`bool<class_bool>` **is_drawing_caret_when_editable_disabled** **(** **)**
  760. If ``true``, caret will be visible when :ref:`editable<class_TextEdit_property_editable>` is disabled.
  761. .. rst-class:: classref-item-separator
  762. ----
  763. .. _class_TextEdit_property_caret_mid_grapheme:
  764. .. rst-class:: classref-property
  765. :ref:`bool<class_bool>` **caret_mid_grapheme** = ``false``
  766. .. rst-class:: classref-property-setget
  767. - void **set_caret_mid_grapheme_enabled** **(** :ref:`bool<class_bool>` value **)**
  768. - :ref:`bool<class_bool>` **is_caret_mid_grapheme_enabled** **(** **)**
  769. Allow moving caret, selecting and removing the individual composite character components.
  770. \ **Note:** :kbd:`Backspace` is always removing individual composite character components.
  771. .. rst-class:: classref-item-separator
  772. ----
  773. .. _class_TextEdit_property_caret_move_on_right_click:
  774. .. rst-class:: classref-property
  775. :ref:`bool<class_bool>` **caret_move_on_right_click** = ``true``
  776. .. rst-class:: classref-property-setget
  777. - void **set_move_caret_on_right_click_enabled** **(** :ref:`bool<class_bool>` value **)**
  778. - :ref:`bool<class_bool>` **is_move_caret_on_right_click_enabled** **(** **)**
  779. If ``true``, a right-click moves the caret at the mouse position before displaying the context menu.
  780. If ``false``, the context menu disregards mouse location.
  781. .. rst-class:: classref-item-separator
  782. ----
  783. .. _class_TextEdit_property_caret_multiple:
  784. .. rst-class:: classref-property
  785. :ref:`bool<class_bool>` **caret_multiple** = ``true``
  786. .. rst-class:: classref-property-setget
  787. - void **set_multiple_carets_enabled** **(** :ref:`bool<class_bool>` value **)**
  788. - :ref:`bool<class_bool>` **is_multiple_carets_enabled** **(** **)**
  789. Sets if multiple carets are allowed.
  790. .. rst-class:: classref-item-separator
  791. ----
  792. .. _class_TextEdit_property_caret_type:
  793. .. rst-class:: classref-property
  794. :ref:`CaretType<enum_TextEdit_CaretType>` **caret_type** = ``0``
  795. .. rst-class:: classref-property-setget
  796. - void **set_caret_type** **(** :ref:`CaretType<enum_TextEdit_CaretType>` value **)**
  797. - :ref:`CaretType<enum_TextEdit_CaretType>` **get_caret_type** **(** **)**
  798. Set the type of caret to draw.
  799. .. rst-class:: classref-item-separator
  800. ----
  801. .. _class_TextEdit_property_context_menu_enabled:
  802. .. rst-class:: classref-property
  803. :ref:`bool<class_bool>` **context_menu_enabled** = ``true``
  804. .. rst-class:: classref-property-setget
  805. - void **set_context_menu_enabled** **(** :ref:`bool<class_bool>` value **)**
  806. - :ref:`bool<class_bool>` **is_context_menu_enabled** **(** **)**
  807. If ``true``, a right-click displays the context menu.
  808. .. rst-class:: classref-item-separator
  809. ----
  810. .. _class_TextEdit_property_deselect_on_focus_loss_enabled:
  811. .. rst-class:: classref-property
  812. :ref:`bool<class_bool>` **deselect_on_focus_loss_enabled** = ``true``
  813. .. rst-class:: classref-property-setget
  814. - void **set_deselect_on_focus_loss_enabled** **(** :ref:`bool<class_bool>` value **)**
  815. - :ref:`bool<class_bool>` **is_deselect_on_focus_loss_enabled** **(** **)**
  816. If ``true``, the selected text will be deselected when focus is lost.
  817. .. rst-class:: classref-item-separator
  818. ----
  819. .. _class_TextEdit_property_drag_and_drop_selection_enabled:
  820. .. rst-class:: classref-property
  821. :ref:`bool<class_bool>` **drag_and_drop_selection_enabled** = ``true``
  822. .. rst-class:: classref-property-setget
  823. - void **set_drag_and_drop_selection_enabled** **(** :ref:`bool<class_bool>` value **)**
  824. - :ref:`bool<class_bool>` **is_drag_and_drop_selection_enabled** **(** **)**
  825. If ``true``, allow drag and drop of selected text.
  826. .. rst-class:: classref-item-separator
  827. ----
  828. .. _class_TextEdit_property_draw_control_chars:
  829. .. rst-class:: classref-property
  830. :ref:`bool<class_bool>` **draw_control_chars** = ``false``
  831. .. rst-class:: classref-property-setget
  832. - void **set_draw_control_chars** **(** :ref:`bool<class_bool>` value **)**
  833. - :ref:`bool<class_bool>` **get_draw_control_chars** **(** **)**
  834. If ``true``, control characters are displayed.
  835. .. rst-class:: classref-item-separator
  836. ----
  837. .. _class_TextEdit_property_draw_spaces:
  838. .. rst-class:: classref-property
  839. :ref:`bool<class_bool>` **draw_spaces** = ``false``
  840. .. rst-class:: classref-property-setget
  841. - void **set_draw_spaces** **(** :ref:`bool<class_bool>` value **)**
  842. - :ref:`bool<class_bool>` **is_drawing_spaces** **(** **)**
  843. If ``true``, the "space" character will have a visible representation.
  844. .. rst-class:: classref-item-separator
  845. ----
  846. .. _class_TextEdit_property_draw_tabs:
  847. .. rst-class:: classref-property
  848. :ref:`bool<class_bool>` **draw_tabs** = ``false``
  849. .. rst-class:: classref-property-setget
  850. - void **set_draw_tabs** **(** :ref:`bool<class_bool>` value **)**
  851. - :ref:`bool<class_bool>` **is_drawing_tabs** **(** **)**
  852. If ``true``, the "tab" character will have a visible representation.
  853. .. rst-class:: classref-item-separator
  854. ----
  855. .. _class_TextEdit_property_editable:
  856. .. rst-class:: classref-property
  857. :ref:`bool<class_bool>` **editable** = ``true``
  858. .. rst-class:: classref-property-setget
  859. - void **set_editable** **(** :ref:`bool<class_bool>` value **)**
  860. - :ref:`bool<class_bool>` **is_editable** **(** **)**
  861. If ``false``, existing text cannot be modified and new text cannot be added.
  862. .. rst-class:: classref-item-separator
  863. ----
  864. .. _class_TextEdit_property_highlight_all_occurrences:
  865. .. rst-class:: classref-property
  866. :ref:`bool<class_bool>` **highlight_all_occurrences** = ``false``
  867. .. rst-class:: classref-property-setget
  868. - void **set_highlight_all_occurrences** **(** :ref:`bool<class_bool>` value **)**
  869. - :ref:`bool<class_bool>` **is_highlight_all_occurrences_enabled** **(** **)**
  870. If ``true``, all occurrences of the selected text will be highlighted.
  871. .. rst-class:: classref-item-separator
  872. ----
  873. .. _class_TextEdit_property_highlight_current_line:
  874. .. rst-class:: classref-property
  875. :ref:`bool<class_bool>` **highlight_current_line** = ``false``
  876. .. rst-class:: classref-property-setget
  877. - void **set_highlight_current_line** **(** :ref:`bool<class_bool>` value **)**
  878. - :ref:`bool<class_bool>` **is_highlight_current_line_enabled** **(** **)**
  879. If ``true``, the line containing the cursor is highlighted.
  880. .. rst-class:: classref-item-separator
  881. ----
  882. .. _class_TextEdit_property_language:
  883. .. rst-class:: classref-property
  884. :ref:`String<class_String>` **language** = ``""``
  885. .. rst-class:: classref-property-setget
  886. - void **set_language** **(** :ref:`String<class_String>` value **)**
  887. - :ref:`String<class_String>` **get_language** **(** **)**
  888. Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  889. .. rst-class:: classref-item-separator
  890. ----
  891. .. _class_TextEdit_property_middle_mouse_paste_enabled:
  892. .. rst-class:: classref-property
  893. :ref:`bool<class_bool>` **middle_mouse_paste_enabled** = ``true``
  894. .. rst-class:: classref-property-setget
  895. - void **set_middle_mouse_paste_enabled** **(** :ref:`bool<class_bool>` value **)**
  896. - :ref:`bool<class_bool>` **is_middle_mouse_paste_enabled** **(** **)**
  897. If ``false``, using middle mouse button to paste clipboard will be disabled.
  898. \ **Note:** This method is only implemented on Linux.
  899. .. rst-class:: classref-item-separator
  900. ----
  901. .. _class_TextEdit_property_minimap_draw:
  902. .. rst-class:: classref-property
  903. :ref:`bool<class_bool>` **minimap_draw** = ``false``
  904. .. rst-class:: classref-property-setget
  905. - void **set_draw_minimap** **(** :ref:`bool<class_bool>` value **)**
  906. - :ref:`bool<class_bool>` **is_drawing_minimap** **(** **)**
  907. If ``true``, a minimap is shown, providing an outline of your source code.
  908. .. rst-class:: classref-item-separator
  909. ----
  910. .. _class_TextEdit_property_minimap_width:
  911. .. rst-class:: classref-property
  912. :ref:`int<class_int>` **minimap_width** = ``80``
  913. .. rst-class:: classref-property-setget
  914. - void **set_minimap_width** **(** :ref:`int<class_int>` value **)**
  915. - :ref:`int<class_int>` **get_minimap_width** **(** **)**
  916. The width, in pixels, of the minimap.
  917. .. rst-class:: classref-item-separator
  918. ----
  919. .. _class_TextEdit_property_placeholder_text:
  920. .. rst-class:: classref-property
  921. :ref:`String<class_String>` **placeholder_text** = ``""``
  922. .. rst-class:: classref-property-setget
  923. - void **set_placeholder** **(** :ref:`String<class_String>` value **)**
  924. - :ref:`String<class_String>` **get_placeholder** **(** **)**
  925. Text shown when the **TextEdit** is empty. It is **not** the **TextEdit**'s default value (see :ref:`text<class_TextEdit_property_text>`).
  926. .. rst-class:: classref-item-separator
  927. ----
  928. .. _class_TextEdit_property_scroll_fit_content_height:
  929. .. rst-class:: classref-property
  930. :ref:`bool<class_bool>` **scroll_fit_content_height** = ``false``
  931. .. rst-class:: classref-property-setget
  932. - void **set_fit_content_height_enabled** **(** :ref:`bool<class_bool>` value **)**
  933. - :ref:`bool<class_bool>` **is_fit_content_height_enabled** **(** **)**
  934. If ``true``, **TextEdit** will disable vertical scroll and fit minimum height to the number of visible lines.
  935. .. rst-class:: classref-item-separator
  936. ----
  937. .. _class_TextEdit_property_scroll_horizontal:
  938. .. rst-class:: classref-property
  939. :ref:`int<class_int>` **scroll_horizontal** = ``0``
  940. .. rst-class:: classref-property-setget
  941. - void **set_h_scroll** **(** :ref:`int<class_int>` value **)**
  942. - :ref:`int<class_int>` **get_h_scroll** **(** **)**
  943. If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels.
  944. .. rst-class:: classref-item-separator
  945. ----
  946. .. _class_TextEdit_property_scroll_past_end_of_file:
  947. .. rst-class:: classref-property
  948. :ref:`bool<class_bool>` **scroll_past_end_of_file** = ``false``
  949. .. rst-class:: classref-property-setget
  950. - void **set_scroll_past_end_of_file_enabled** **(** :ref:`bool<class_bool>` value **)**
  951. - :ref:`bool<class_bool>` **is_scroll_past_end_of_file_enabled** **(** **)**
  952. Allow scrolling past the last line into "virtual" space.
  953. .. rst-class:: classref-item-separator
  954. ----
  955. .. _class_TextEdit_property_scroll_smooth:
  956. .. rst-class:: classref-property
  957. :ref:`bool<class_bool>` **scroll_smooth** = ``false``
  958. .. rst-class:: classref-property-setget
  959. - void **set_smooth_scroll_enabled** **(** :ref:`bool<class_bool>` value **)**
  960. - :ref:`bool<class_bool>` **is_smooth_scroll_enabled** **(** **)**
  961. Scroll smoothly over the text rather than jumping to the next location.
  962. .. rst-class:: classref-item-separator
  963. ----
  964. .. _class_TextEdit_property_scroll_v_scroll_speed:
  965. .. rst-class:: classref-property
  966. :ref:`float<class_float>` **scroll_v_scroll_speed** = ``80.0``
  967. .. rst-class:: classref-property-setget
  968. - void **set_v_scroll_speed** **(** :ref:`float<class_float>` value **)**
  969. - :ref:`float<class_float>` **get_v_scroll_speed** **(** **)**
  970. Sets the scroll speed with the minimap or when :ref:`scroll_smooth<class_TextEdit_property_scroll_smooth>` is enabled.
  971. .. rst-class:: classref-item-separator
  972. ----
  973. .. _class_TextEdit_property_scroll_vertical:
  974. .. rst-class:: classref-property
  975. :ref:`float<class_float>` **scroll_vertical** = ``0.0``
  976. .. rst-class:: classref-property-setget
  977. - void **set_v_scroll** **(** :ref:`float<class_float>` value **)**
  978. - :ref:`float<class_float>` **get_v_scroll** **(** **)**
  979. If there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line.
  980. .. rst-class:: classref-item-separator
  981. ----
  982. .. _class_TextEdit_property_selecting_enabled:
  983. .. rst-class:: classref-property
  984. :ref:`bool<class_bool>` **selecting_enabled** = ``true``
  985. .. rst-class:: classref-property-setget
  986. - void **set_selecting_enabled** **(** :ref:`bool<class_bool>` value **)**
  987. - :ref:`bool<class_bool>` **is_selecting_enabled** **(** **)**
  988. If ``true``, text can be selected.
  989. If ``false``, text can not be selected by the user or by the :ref:`select<class_TextEdit_method_select>` or :ref:`select_all<class_TextEdit_method_select_all>` methods.
  990. .. rst-class:: classref-item-separator
  991. ----
  992. .. _class_TextEdit_property_shortcut_keys_enabled:
  993. .. rst-class:: classref-property
  994. :ref:`bool<class_bool>` **shortcut_keys_enabled** = ``true``
  995. .. rst-class:: classref-property-setget
  996. - void **set_shortcut_keys_enabled** **(** :ref:`bool<class_bool>` value **)**
  997. - :ref:`bool<class_bool>` **is_shortcut_keys_enabled** **(** **)**
  998. If ``true``, shortcut keys for context menu items are enabled, even if the context menu is disabled.
  999. .. rst-class:: classref-item-separator
  1000. ----
  1001. .. _class_TextEdit_property_structured_text_bidi_override:
  1002. .. rst-class:: classref-property
  1003. :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **structured_text_bidi_override** = ``0``
  1004. .. rst-class:: classref-property-setget
  1005. - void **set_structured_text_bidi_override** **(** :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` value **)**
  1006. - :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **get_structured_text_bidi_override** **(** **)**
  1007. Set BiDi algorithm override for the structured text.
  1008. .. rst-class:: classref-item-separator
  1009. ----
  1010. .. _class_TextEdit_property_structured_text_bidi_override_options:
  1011. .. rst-class:: classref-property
  1012. :ref:`Array<class_Array>` **structured_text_bidi_override_options** = ``[]``
  1013. .. rst-class:: classref-property-setget
  1014. - void **set_structured_text_bidi_override_options** **(** :ref:`Array<class_Array>` value **)**
  1015. - :ref:`Array<class_Array>` **get_structured_text_bidi_override_options** **(** **)**
  1016. Set additional options for BiDi override.
  1017. .. rst-class:: classref-item-separator
  1018. ----
  1019. .. _class_TextEdit_property_syntax_highlighter:
  1020. .. rst-class:: classref-property
  1021. :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` **syntax_highlighter**
  1022. .. rst-class:: classref-property-setget
  1023. - void **set_syntax_highlighter** **(** :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` value **)**
  1024. - :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` **get_syntax_highlighter** **(** **)**
  1025. Sets the :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` to use.
  1026. .. rst-class:: classref-item-separator
  1027. ----
  1028. .. _class_TextEdit_property_text:
  1029. .. rst-class:: classref-property
  1030. :ref:`String<class_String>` **text** = ``""``
  1031. .. rst-class:: classref-property-setget
  1032. - void **set_text** **(** :ref:`String<class_String>` value **)**
  1033. - :ref:`String<class_String>` **get_text** **(** **)**
  1034. String value of the **TextEdit**.
  1035. .. rst-class:: classref-item-separator
  1036. ----
  1037. .. _class_TextEdit_property_text_direction:
  1038. .. rst-class:: classref-property
  1039. :ref:`TextDirection<enum_Control_TextDirection>` **text_direction** = ``0``
  1040. .. rst-class:: classref-property-setget
  1041. - void **set_text_direction** **(** :ref:`TextDirection<enum_Control_TextDirection>` value **)**
  1042. - :ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction** **(** **)**
  1043. Base text writing direction.
  1044. .. rst-class:: classref-item-separator
  1045. ----
  1046. .. _class_TextEdit_property_virtual_keyboard_enabled:
  1047. .. rst-class:: classref-property
  1048. :ref:`bool<class_bool>` **virtual_keyboard_enabled** = ``true``
  1049. .. rst-class:: classref-property-setget
  1050. - void **set_virtual_keyboard_enabled** **(** :ref:`bool<class_bool>` value **)**
  1051. - :ref:`bool<class_bool>` **is_virtual_keyboard_enabled** **(** **)**
  1052. If ``true``, the native virtual keyboard is shown when focused on platforms that support it.
  1053. .. rst-class:: classref-item-separator
  1054. ----
  1055. .. _class_TextEdit_property_wrap_mode:
  1056. .. rst-class:: classref-property
  1057. :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` **wrap_mode** = ``0``
  1058. .. rst-class:: classref-property-setget
  1059. - void **set_line_wrapping_mode** **(** :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` value **)**
  1060. - :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` **get_line_wrapping_mode** **(** **)**
  1061. Sets the line wrapping mode to use.
  1062. .. rst-class:: classref-section-separator
  1063. ----
  1064. .. rst-class:: classref-descriptions-group
  1065. Method Descriptions
  1066. -------------------
  1067. .. _class_TextEdit_private_method__backspace:
  1068. .. rst-class:: classref-method
  1069. void **_backspace** **(** :ref:`int<class_int>` caret_index **)** |virtual|
  1070. Override this method to define what happens when the user presses the backspace key.
  1071. .. rst-class:: classref-item-separator
  1072. ----
  1073. .. _class_TextEdit_private_method__copy:
  1074. .. rst-class:: classref-method
  1075. void **_copy** **(** :ref:`int<class_int>` caret_index **)** |virtual|
  1076. Override this method to define what happens when the user performs a copy operation.
  1077. .. rst-class:: classref-item-separator
  1078. ----
  1079. .. _class_TextEdit_private_method__cut:
  1080. .. rst-class:: classref-method
  1081. void **_cut** **(** :ref:`int<class_int>` caret_index **)** |virtual|
  1082. Override this method to define what happens when the user performs a cut operation.
  1083. .. rst-class:: classref-item-separator
  1084. ----
  1085. .. _class_TextEdit_private_method__handle_unicode_input:
  1086. .. rst-class:: classref-method
  1087. void **_handle_unicode_input** **(** :ref:`int<class_int>` unicode_char, :ref:`int<class_int>` caret_index **)** |virtual|
  1088. Override this method to define what happens when the user types in the provided key ``unicode_char``.
  1089. .. rst-class:: classref-item-separator
  1090. ----
  1091. .. _class_TextEdit_private_method__paste:
  1092. .. rst-class:: classref-method
  1093. void **_paste** **(** :ref:`int<class_int>` caret_index **)** |virtual|
  1094. Override this method to define what happens when the user performs a paste operation.
  1095. .. rst-class:: classref-item-separator
  1096. ----
  1097. .. _class_TextEdit_private_method__paste_primary_clipboard:
  1098. .. rst-class:: classref-method
  1099. void **_paste_primary_clipboard** **(** :ref:`int<class_int>` caret_index **)** |virtual|
  1100. Override this method to define what happens when the user performs a paste operation with middle mouse button.
  1101. \ **Note:** This method is only implemented on Linux.
  1102. .. rst-class:: classref-item-separator
  1103. ----
  1104. .. _class_TextEdit_method_add_caret:
  1105. .. rst-class:: classref-method
  1106. :ref:`int<class_int>` **add_caret** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` col **)**
  1107. Adds a new caret at the given location. Returns the index of the new caret, or ``-1`` if the location is invalid.
  1108. .. rst-class:: classref-item-separator
  1109. ----
  1110. .. _class_TextEdit_method_add_caret_at_carets:
  1111. .. rst-class:: classref-method
  1112. void **add_caret_at_carets** **(** :ref:`bool<class_bool>` below **)**
  1113. Adds an additional caret above or below every caret. If ``below`` is true the new caret will be added below and above otherwise.
  1114. .. rst-class:: classref-item-separator
  1115. ----
  1116. .. _class_TextEdit_method_add_gutter:
  1117. .. rst-class:: classref-method
  1118. void **add_gutter** **(** :ref:`int<class_int>` at=-1 **)**
  1119. Register a new gutter to this **TextEdit**. Use ``at`` to have a specific gutter order. A value of ``-1`` appends the gutter to the right.
  1120. .. rst-class:: classref-item-separator
  1121. ----
  1122. .. _class_TextEdit_method_add_selection_for_next_occurrence:
  1123. .. rst-class:: classref-method
  1124. void **add_selection_for_next_occurrence** **(** **)**
  1125. Adds a selection and a caret for the next occurrence of the current selection. If there is no active selection, selects word under caret.
  1126. .. rst-class:: classref-item-separator
  1127. ----
  1128. .. _class_TextEdit_method_adjust_carets_after_edit:
  1129. .. rst-class:: classref-method
  1130. void **adjust_carets_after_edit** **(** :ref:`int<class_int>` caret, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_col, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_col **)**
  1131. Reposition the carets affected by the edit. This assumes edits are applied in edit order, see :ref:`get_caret_index_edit_order<class_TextEdit_method_get_caret_index_edit_order>`.
  1132. .. rst-class:: classref-item-separator
  1133. ----
  1134. .. _class_TextEdit_method_adjust_viewport_to_caret:
  1135. .. rst-class:: classref-method
  1136. void **adjust_viewport_to_caret** **(** :ref:`int<class_int>` caret_index=0 **)**
  1137. Adjust the viewport so the caret is visible.
  1138. .. rst-class:: classref-item-separator
  1139. ----
  1140. .. _class_TextEdit_method_backspace:
  1141. .. rst-class:: classref-method
  1142. void **backspace** **(** :ref:`int<class_int>` caret_index=-1 **)**
  1143. Called when the user presses the backspace key. Can be overridden with :ref:`_backspace<class_TextEdit_private_method__backspace>`.
  1144. .. rst-class:: classref-item-separator
  1145. ----
  1146. .. _class_TextEdit_method_begin_complex_operation:
  1147. .. rst-class:: classref-method
  1148. void **begin_complex_operation** **(** **)**
  1149. Starts a multipart edit. All edits will be treated as one action until :ref:`end_complex_operation<class_TextEdit_method_end_complex_operation>` is called.
  1150. .. rst-class:: classref-item-separator
  1151. ----
  1152. .. _class_TextEdit_method_center_viewport_to_caret:
  1153. .. rst-class:: classref-method
  1154. void **center_viewport_to_caret** **(** :ref:`int<class_int>` caret_index=0 **)**
  1155. Centers the viewport on the line the editing caret is at. This also resets the :ref:`scroll_horizontal<class_TextEdit_property_scroll_horizontal>` value to ``0``.
  1156. .. rst-class:: classref-item-separator
  1157. ----
  1158. .. _class_TextEdit_method_clear:
  1159. .. rst-class:: classref-method
  1160. void **clear** **(** **)**
  1161. Performs a full reset of **TextEdit**, including undo history.
  1162. .. rst-class:: classref-item-separator
  1163. ----
  1164. .. _class_TextEdit_method_clear_undo_history:
  1165. .. rst-class:: classref-method
  1166. void **clear_undo_history** **(** **)**
  1167. Clears the undo history.
  1168. .. rst-class:: classref-item-separator
  1169. ----
  1170. .. _class_TextEdit_method_copy:
  1171. .. rst-class:: classref-method
  1172. void **copy** **(** :ref:`int<class_int>` caret_index=-1 **)**
  1173. Copies the current text selection. Can be overridden with :ref:`_copy<class_TextEdit_private_method__copy>`.
  1174. .. rst-class:: classref-item-separator
  1175. ----
  1176. .. _class_TextEdit_method_cut:
  1177. .. rst-class:: classref-method
  1178. void **cut** **(** :ref:`int<class_int>` caret_index=-1 **)**
  1179. Cut's the current selection. Can be overridden with :ref:`_cut<class_TextEdit_private_method__cut>`.
  1180. .. rst-class:: classref-item-separator
  1181. ----
  1182. .. _class_TextEdit_method_delete_selection:
  1183. .. rst-class:: classref-method
  1184. void **delete_selection** **(** :ref:`int<class_int>` caret_index=-1 **)**
  1185. Deletes the selected text.
  1186. .. rst-class:: classref-item-separator
  1187. ----
  1188. .. _class_TextEdit_method_deselect:
  1189. .. rst-class:: classref-method
  1190. void **deselect** **(** :ref:`int<class_int>` caret_index=-1 **)**
  1191. Deselects the current selection.
  1192. .. rst-class:: classref-item-separator
  1193. ----
  1194. .. _class_TextEdit_method_end_action:
  1195. .. rst-class:: classref-method
  1196. void **end_action** **(** **)**
  1197. Marks the end of steps in the current action started with :ref:`start_action<class_TextEdit_method_start_action>`.
  1198. .. rst-class:: classref-item-separator
  1199. ----
  1200. .. _class_TextEdit_method_end_complex_operation:
  1201. .. rst-class:: classref-method
  1202. void **end_complex_operation** **(** **)**
  1203. Ends a multipart edit, started with :ref:`begin_complex_operation<class_TextEdit_method_begin_complex_operation>`. If called outside a complex operation, the current operation is pushed onto the undo/redo stack.
  1204. .. rst-class:: classref-item-separator
  1205. ----
  1206. .. _class_TextEdit_method_get_caret_column:
  1207. .. rst-class:: classref-method
  1208. :ref:`int<class_int>` **get_caret_column** **(** :ref:`int<class_int>` caret_index=0 **)** |const|
  1209. Returns the column the editing caret is at.
  1210. .. rst-class:: classref-item-separator
  1211. ----
  1212. .. _class_TextEdit_method_get_caret_count:
  1213. .. rst-class:: classref-method
  1214. :ref:`int<class_int>` **get_caret_count** **(** **)** |const|
  1215. Returns the number of carets in this **TextEdit**.
  1216. .. rst-class:: classref-item-separator
  1217. ----
  1218. .. _class_TextEdit_method_get_caret_draw_pos:
  1219. .. rst-class:: classref-method
  1220. :ref:`Vector2<class_Vector2>` **get_caret_draw_pos** **(** :ref:`int<class_int>` caret_index=0 **)** |const|
  1221. Returns the caret pixel draw position.
  1222. .. rst-class:: classref-item-separator
  1223. ----
  1224. .. _class_TextEdit_method_get_caret_index_edit_order:
  1225. .. rst-class:: classref-method
  1226. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_caret_index_edit_order** **(** **)**
  1227. Returns a list of caret indexes in their edit order, this done from bottom to top. Edit order refers to the way actions such as :ref:`insert_text_at_caret<class_TextEdit_method_insert_text_at_caret>` are applied.
  1228. .. rst-class:: classref-item-separator
  1229. ----
  1230. .. _class_TextEdit_method_get_caret_line:
  1231. .. rst-class:: classref-method
  1232. :ref:`int<class_int>` **get_caret_line** **(** :ref:`int<class_int>` caret_index=0 **)** |const|
  1233. Returns the line the editing caret is on.
  1234. .. rst-class:: classref-item-separator
  1235. ----
  1236. .. _class_TextEdit_method_get_caret_wrap_index:
  1237. .. rst-class:: classref-method
  1238. :ref:`int<class_int>` **get_caret_wrap_index** **(** :ref:`int<class_int>` caret_index=0 **)** |const|
  1239. Returns the wrap index the editing caret is on.
  1240. .. rst-class:: classref-item-separator
  1241. ----
  1242. .. _class_TextEdit_method_get_first_non_whitespace_column:
  1243. .. rst-class:: classref-method
  1244. :ref:`int<class_int>` **get_first_non_whitespace_column** **(** :ref:`int<class_int>` line **)** |const|
  1245. Returns the first column containing a non-whitespace character.
  1246. .. rst-class:: classref-item-separator
  1247. ----
  1248. .. _class_TextEdit_method_get_first_visible_line:
  1249. .. rst-class:: classref-method
  1250. :ref:`int<class_int>` **get_first_visible_line** **(** **)** |const|
  1251. Returns the first visible line.
  1252. .. rst-class:: classref-item-separator
  1253. ----
  1254. .. _class_TextEdit_method_get_gutter_count:
  1255. .. rst-class:: classref-method
  1256. :ref:`int<class_int>` **get_gutter_count** **(** **)** |const|
  1257. Returns the number of gutters registered.
  1258. .. rst-class:: classref-item-separator
  1259. ----
  1260. .. _class_TextEdit_method_get_gutter_name:
  1261. .. rst-class:: classref-method
  1262. :ref:`String<class_String>` **get_gutter_name** **(** :ref:`int<class_int>` gutter **)** |const|
  1263. Returns the name of the gutter at the given index.
  1264. .. rst-class:: classref-item-separator
  1265. ----
  1266. .. _class_TextEdit_method_get_gutter_type:
  1267. .. rst-class:: classref-method
  1268. :ref:`GutterType<enum_TextEdit_GutterType>` **get_gutter_type** **(** :ref:`int<class_int>` gutter **)** |const|
  1269. Returns the type of the gutter at the given index.
  1270. .. rst-class:: classref-item-separator
  1271. ----
  1272. .. _class_TextEdit_method_get_gutter_width:
  1273. .. rst-class:: classref-method
  1274. :ref:`int<class_int>` **get_gutter_width** **(** :ref:`int<class_int>` gutter **)** |const|
  1275. Returns the width of the gutter at the given index.
  1276. .. rst-class:: classref-item-separator
  1277. ----
  1278. .. _class_TextEdit_method_get_h_scroll_bar:
  1279. .. rst-class:: classref-method
  1280. :ref:`HScrollBar<class_HScrollBar>` **get_h_scroll_bar** **(** **)** |const|
  1281. Returns the :ref:`HScrollBar<class_HScrollBar>` used by **TextEdit**.
  1282. .. rst-class:: classref-item-separator
  1283. ----
  1284. .. _class_TextEdit_method_get_indent_level:
  1285. .. rst-class:: classref-method
  1286. :ref:`int<class_int>` **get_indent_level** **(** :ref:`int<class_int>` line **)** |const|
  1287. Returns the number of spaces and ``tab * tab_size`` before the first char.
  1288. .. rst-class:: classref-item-separator
  1289. ----
  1290. .. _class_TextEdit_method_get_last_full_visible_line:
  1291. .. rst-class:: classref-method
  1292. :ref:`int<class_int>` **get_last_full_visible_line** **(** **)** |const|
  1293. Returns the last visible line. Use :ref:`get_last_full_visible_line_wrap_index<class_TextEdit_method_get_last_full_visible_line_wrap_index>` for the wrap index.
  1294. .. rst-class:: classref-item-separator
  1295. ----
  1296. .. _class_TextEdit_method_get_last_full_visible_line_wrap_index:
  1297. .. rst-class:: classref-method
  1298. :ref:`int<class_int>` **get_last_full_visible_line_wrap_index** **(** **)** |const|
  1299. Returns the last visible wrap index of the last visible line.
  1300. .. rst-class:: classref-item-separator
  1301. ----
  1302. .. _class_TextEdit_method_get_last_unhidden_line:
  1303. .. rst-class:: classref-method
  1304. :ref:`int<class_int>` **get_last_unhidden_line** **(** **)** |const|
  1305. Returns the last unhidden line in the entire **TextEdit**.
  1306. .. rst-class:: classref-item-separator
  1307. ----
  1308. .. _class_TextEdit_method_get_line:
  1309. .. rst-class:: classref-method
  1310. :ref:`String<class_String>` **get_line** **(** :ref:`int<class_int>` line **)** |const|
  1311. Returns the text of a specific line.
  1312. .. rst-class:: classref-item-separator
  1313. ----
  1314. .. _class_TextEdit_method_get_line_background_color:
  1315. .. rst-class:: classref-method
  1316. :ref:`Color<class_Color>` **get_line_background_color** **(** :ref:`int<class_int>` line **)** |const|
  1317. Returns the current background color of the line. ``Color(0, 0, 0, 0)`` is returned if no color is set.
  1318. .. rst-class:: classref-item-separator
  1319. ----
  1320. .. _class_TextEdit_method_get_line_column_at_pos:
  1321. .. rst-class:: classref-method
  1322. :ref:`Vector2i<class_Vector2i>` **get_line_column_at_pos** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`bool<class_bool>` allow_out_of_bounds=true **)** |const|
  1323. Returns the line and column at the given position. In the returned vector, ``x`` is the column, ``y`` is the line. If ``allow_out_of_bounds`` is ``false`` and the position is not over the text, both vector values will be set to ``-1``.
  1324. .. rst-class:: classref-item-separator
  1325. ----
  1326. .. _class_TextEdit_method_get_line_count:
  1327. .. rst-class:: classref-method
  1328. :ref:`int<class_int>` **get_line_count** **(** **)** |const|
  1329. Returns the number of lines in the text.
  1330. .. rst-class:: classref-item-separator
  1331. ----
  1332. .. _class_TextEdit_method_get_line_gutter_icon:
  1333. .. rst-class:: classref-method
  1334. :ref:`Texture2D<class_Texture2D>` **get_line_gutter_icon** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
  1335. Returns the icon currently in ``gutter`` at ``line``.
  1336. .. rst-class:: classref-item-separator
  1337. ----
  1338. .. _class_TextEdit_method_get_line_gutter_item_color:
  1339. .. rst-class:: classref-method
  1340. :ref:`Color<class_Color>` **get_line_gutter_item_color** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
  1341. Returns the color currently in ``gutter`` at ``line``.
  1342. .. rst-class:: classref-item-separator
  1343. ----
  1344. .. _class_TextEdit_method_get_line_gutter_metadata:
  1345. .. rst-class:: classref-method
  1346. :ref:`Variant<class_Variant>` **get_line_gutter_metadata** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
  1347. Returns the metadata currently in ``gutter`` at ``line``.
  1348. .. rst-class:: classref-item-separator
  1349. ----
  1350. .. _class_TextEdit_method_get_line_gutter_text:
  1351. .. rst-class:: classref-method
  1352. :ref:`String<class_String>` **get_line_gutter_text** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
  1353. Returns the text currently in ``gutter`` at ``line``.
  1354. .. rst-class:: classref-item-separator
  1355. ----
  1356. .. _class_TextEdit_method_get_line_height:
  1357. .. rst-class:: classref-method
  1358. :ref:`int<class_int>` **get_line_height** **(** **)** |const|
  1359. Returns the maximum value of the line height among all lines.
  1360. \ **Note:** The return value is influenced by :ref:`line_spacing<class_TextEdit_theme_constant_line_spacing>` and :ref:`font_size<class_TextEdit_theme_font_size_font_size>`. And it will not be less than ``1``.
  1361. .. rst-class:: classref-item-separator
  1362. ----
  1363. .. _class_TextEdit_method_get_line_width:
  1364. .. rst-class:: classref-method
  1365. :ref:`int<class_int>` **get_line_width** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=-1 **)** |const|
  1366. Returns the width in pixels of the ``wrap_index`` on ``line``.
  1367. .. rst-class:: classref-item-separator
  1368. ----
  1369. .. _class_TextEdit_method_get_line_wrap_count:
  1370. .. rst-class:: classref-method
  1371. :ref:`int<class_int>` **get_line_wrap_count** **(** :ref:`int<class_int>` line **)** |const|
  1372. Returns the number of times the given line is wrapped.
  1373. .. rst-class:: classref-item-separator
  1374. ----
  1375. .. _class_TextEdit_method_get_line_wrap_index_at_column:
  1376. .. rst-class:: classref-method
  1377. :ref:`int<class_int>` **get_line_wrap_index_at_column** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
  1378. Returns the wrap index of the given line column.
  1379. .. rst-class:: classref-item-separator
  1380. ----
  1381. .. _class_TextEdit_method_get_line_wrapped_text:
  1382. .. rst-class:: classref-method
  1383. :ref:`PackedStringArray<class_PackedStringArray>` **get_line_wrapped_text** **(** :ref:`int<class_int>` line **)** |const|
  1384. Returns an array of :ref:`String<class_String>`\ s representing each wrapped index.
  1385. .. rst-class:: classref-item-separator
  1386. ----
  1387. .. _class_TextEdit_method_get_local_mouse_pos:
  1388. .. rst-class:: classref-method
  1389. :ref:`Vector2<class_Vector2>` **get_local_mouse_pos** **(** **)** |const|
  1390. Returns the local mouse position adjusted for the text direction.
  1391. .. rst-class:: classref-item-separator
  1392. ----
  1393. .. _class_TextEdit_method_get_menu:
  1394. .. rst-class:: classref-method
  1395. :ref:`PopupMenu<class_PopupMenu>` **get_menu** **(** **)** |const|
  1396. Returns the :ref:`PopupMenu<class_PopupMenu>` of this **TextEdit**. By default, this menu is displayed when right-clicking on the **TextEdit**.
  1397. You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see :ref:`MenuItems<enum_TextEdit_MenuItems>`). For example:
  1398. .. tabs::
  1399. .. code-tab:: gdscript
  1400. func _ready():
  1401. var menu = get_menu()
  1402. # Remove all items after "Redo".
  1403. menu.item_count = menu.get_item_index(MENU_REDO) + 1
  1404. # Add custom items.
  1405. menu.add_separator()
  1406. menu.add_item("Insert Date", MENU_MAX + 1)
  1407. # Connect callback.
  1408. menu.id_pressed.connect(_on_item_pressed)
  1409. func _on_item_pressed(id):
  1410. if id == MENU_MAX + 1:
  1411. insert_text_at_caret(Time.get_date_string_from_system())
  1412. .. code-tab:: csharp
  1413. public override void _Ready()
  1414. {
  1415. var menu = GetMenu();
  1416. // Remove all items after "Redo".
  1417. menu.ItemCount = menu.GetItemIndex(TextEdit.MenuItems.Redo) + 1;
  1418. // Add custom items.
  1419. menu.AddSeparator();
  1420. menu.AddItem("Insert Date", TextEdit.MenuItems.Max + 1);
  1421. // Add event handler.
  1422. menu.IdPressed += OnItemPressed;
  1423. }
  1424. public void OnItemPressed(int id)
  1425. {
  1426. if (id == TextEdit.MenuItems.Max + 1)
  1427. {
  1428. InsertTextAtCaret(Time.GetDateStringFromSystem());
  1429. }
  1430. }
  1431. \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`Window.visible<class_Window_property_visible>` property.
  1432. .. rst-class:: classref-item-separator
  1433. ----
  1434. .. _class_TextEdit_method_get_minimap_line_at_pos:
  1435. .. rst-class:: classref-method
  1436. :ref:`int<class_int>` **get_minimap_line_at_pos** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  1437. Returns the equivalent minimap line at ``position``.
  1438. .. rst-class:: classref-item-separator
  1439. ----
  1440. .. _class_TextEdit_method_get_minimap_visible_lines:
  1441. .. rst-class:: classref-method
  1442. :ref:`int<class_int>` **get_minimap_visible_lines** **(** **)** |const|
  1443. Returns the number of lines that may be drawn on the minimap.
  1444. .. rst-class:: classref-item-separator
  1445. ----
  1446. .. _class_TextEdit_method_get_next_visible_line_index_offset_from:
  1447. .. rst-class:: classref-method
  1448. :ref:`Vector2i<class_Vector2i>` **get_next_visible_line_index_offset_from** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index, :ref:`int<class_int>` visible_amount **)** |const|
  1449. Similar to :ref:`get_next_visible_line_offset_from<class_TextEdit_method_get_next_visible_line_offset_from>`, but takes into account the line wrap indexes. In the returned vector, ``x`` is the line, ``y`` is the wrap index.
  1450. .. rst-class:: classref-item-separator
  1451. ----
  1452. .. _class_TextEdit_method_get_next_visible_line_offset_from:
  1453. .. rst-class:: classref-method
  1454. :ref:`int<class_int>` **get_next_visible_line_offset_from** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` visible_amount **)** |const|
  1455. Returns the count to the next visible line from ``line`` to ``line + visible_amount``. Can also count backwards. For example if a **TextEdit** has 5 lines with lines 2 and 3 hidden, calling this with ``line = 1, visible_amount = 1`` would return 3.
  1456. .. rst-class:: classref-item-separator
  1457. ----
  1458. .. _class_TextEdit_method_get_pos_at_line_column:
  1459. .. rst-class:: classref-method
  1460. :ref:`Vector2i<class_Vector2i>` **get_pos_at_line_column** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
  1461. Returns the local position for the given ``line`` and ``column``. If ``x`` or ``y`` of the returned vector equal ``-1``, the position is outside of the viewable area of the control.
  1462. \ **Note:** The Y position corresponds to the bottom side of the line. Use :ref:`get_rect_at_line_column<class_TextEdit_method_get_rect_at_line_column>` to get the top side position.
  1463. .. rst-class:: classref-item-separator
  1464. ----
  1465. .. _class_TextEdit_method_get_rect_at_line_column:
  1466. .. rst-class:: classref-method
  1467. :ref:`Rect2i<class_Rect2i>` **get_rect_at_line_column** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
  1468. Returns the local position and size for the grapheme at the given ``line`` and ``column``. If ``x`` or ``y`` position of the returned rect equal ``-1``, the position is outside of the viewable area of the control.
  1469. \ **Note:** The Y position of the returned rect corresponds to the top side of the line, unlike :ref:`get_pos_at_line_column<class_TextEdit_method_get_pos_at_line_column>` which returns the bottom side.
  1470. .. rst-class:: classref-item-separator
  1471. ----
  1472. .. _class_TextEdit_method_get_saved_version:
  1473. .. rst-class:: classref-method
  1474. :ref:`int<class_int>` **get_saved_version** **(** **)** |const|
  1475. Returns the last tagged saved version from :ref:`tag_saved_version<class_TextEdit_method_tag_saved_version>`.
  1476. .. rst-class:: classref-item-separator
  1477. ----
  1478. .. _class_TextEdit_method_get_scroll_pos_for_line:
  1479. .. rst-class:: classref-method
  1480. :ref:`float<class_float>` **get_scroll_pos_for_line** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |const|
  1481. Returns the scroll position for ``wrap_index`` of ``line``.
  1482. .. rst-class:: classref-item-separator
  1483. ----
  1484. .. _class_TextEdit_method_get_selected_text:
  1485. .. rst-class:: classref-method
  1486. :ref:`String<class_String>` **get_selected_text** **(** :ref:`int<class_int>` caret_index=-1 **)**
  1487. Returns the text inside the selection of a caret, or all the carets if ``caret_index`` is its default value ``-1``.
  1488. .. rst-class:: classref-item-separator
  1489. ----
  1490. .. _class_TextEdit_method_get_selection_column:
  1491. .. rst-class:: classref-method
  1492. :ref:`int<class_int>` **get_selection_column** **(** :ref:`int<class_int>` caret_index=0 **)** |const|
  1493. Returns the original start column of the selection.
  1494. .. rst-class:: classref-item-separator
  1495. ----
  1496. .. _class_TextEdit_method_get_selection_from_column:
  1497. .. rst-class:: classref-method
  1498. :ref:`int<class_int>` **get_selection_from_column** **(** :ref:`int<class_int>` caret_index=0 **)** |const|
  1499. Returns the selection begin column.
  1500. .. rst-class:: classref-item-separator
  1501. ----
  1502. .. _class_TextEdit_method_get_selection_from_line:
  1503. .. rst-class:: classref-method
  1504. :ref:`int<class_int>` **get_selection_from_line** **(** :ref:`int<class_int>` caret_index=0 **)** |const|
  1505. Returns the selection begin line.
  1506. .. rst-class:: classref-item-separator
  1507. ----
  1508. .. _class_TextEdit_method_get_selection_line:
  1509. .. rst-class:: classref-method
  1510. :ref:`int<class_int>` **get_selection_line** **(** :ref:`int<class_int>` caret_index=0 **)** |const|
  1511. Returns the original start line of the selection.
  1512. .. rst-class:: classref-item-separator
  1513. ----
  1514. .. _class_TextEdit_method_get_selection_mode:
  1515. .. rst-class:: classref-method
  1516. :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **get_selection_mode** **(** **)** |const|
  1517. Returns the current selection mode.
  1518. .. rst-class:: classref-item-separator
  1519. ----
  1520. .. _class_TextEdit_method_get_selection_to_column:
  1521. .. rst-class:: classref-method
  1522. :ref:`int<class_int>` **get_selection_to_column** **(** :ref:`int<class_int>` caret_index=0 **)** |const|
  1523. Returns the selection end column.
  1524. .. rst-class:: classref-item-separator
  1525. ----
  1526. .. _class_TextEdit_method_get_selection_to_line:
  1527. .. rst-class:: classref-method
  1528. :ref:`int<class_int>` **get_selection_to_line** **(** :ref:`int<class_int>` caret_index=0 **)** |const|
  1529. Returns the selection end line.
  1530. .. rst-class:: classref-item-separator
  1531. ----
  1532. .. _class_TextEdit_method_get_tab_size:
  1533. .. rst-class:: classref-method
  1534. :ref:`int<class_int>` **get_tab_size** **(** **)** |const|
  1535. Returns the **TextEdit**'s' tab size.
  1536. .. rst-class:: classref-item-separator
  1537. ----
  1538. .. _class_TextEdit_method_get_total_gutter_width:
  1539. .. rst-class:: classref-method
  1540. :ref:`int<class_int>` **get_total_gutter_width** **(** **)** |const|
  1541. Returns the total width of all gutters and internal padding.
  1542. .. rst-class:: classref-item-separator
  1543. ----
  1544. .. _class_TextEdit_method_get_total_visible_line_count:
  1545. .. rst-class:: classref-method
  1546. :ref:`int<class_int>` **get_total_visible_line_count** **(** **)** |const|
  1547. Returns the number of lines that may be drawn.
  1548. .. rst-class:: classref-item-separator
  1549. ----
  1550. .. _class_TextEdit_method_get_v_scroll_bar:
  1551. .. rst-class:: classref-method
  1552. :ref:`VScrollBar<class_VScrollBar>` **get_v_scroll_bar** **(** **)** |const|
  1553. Returns the :ref:`VScrollBar<class_VScrollBar>` of the **TextEdit**.
  1554. .. rst-class:: classref-item-separator
  1555. ----
  1556. .. _class_TextEdit_method_get_version:
  1557. .. rst-class:: classref-method
  1558. :ref:`int<class_int>` **get_version** **(** **)** |const|
  1559. Returns the current version of the **TextEdit**. The version is a count of recorded operations by the undo/redo history.
  1560. .. rst-class:: classref-item-separator
  1561. ----
  1562. .. _class_TextEdit_method_get_visible_line_count:
  1563. .. rst-class:: classref-method
  1564. :ref:`int<class_int>` **get_visible_line_count** **(** **)** |const|
  1565. Returns the number of visible lines, including wrapped text.
  1566. .. rst-class:: classref-item-separator
  1567. ----
  1568. .. _class_TextEdit_method_get_visible_line_count_in_range:
  1569. .. rst-class:: classref-method
  1570. :ref:`int<class_int>` **get_visible_line_count_in_range** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)** |const|
  1571. Returns the total number of visible + wrapped lines between the two lines.
  1572. .. rst-class:: classref-item-separator
  1573. ----
  1574. .. _class_TextEdit_method_get_word_at_pos:
  1575. .. rst-class:: classref-method
  1576. :ref:`String<class_String>` **get_word_at_pos** **(** :ref:`Vector2<class_Vector2>` position **)** |const|
  1577. Returns the word at ``position``.
  1578. .. rst-class:: classref-item-separator
  1579. ----
  1580. .. _class_TextEdit_method_get_word_under_caret:
  1581. .. rst-class:: classref-method
  1582. :ref:`String<class_String>` **get_word_under_caret** **(** :ref:`int<class_int>` caret_index=-1 **)** |const|
  1583. Returns a :ref:`String<class_String>` text with the word under the caret's location.
  1584. .. rst-class:: classref-item-separator
  1585. ----
  1586. .. _class_TextEdit_method_has_ime_text:
  1587. .. rst-class:: classref-method
  1588. :ref:`bool<class_bool>` **has_ime_text** **(** **)** |const|
  1589. Returns if the user has IME text.
  1590. .. rst-class:: classref-item-separator
  1591. ----
  1592. .. _class_TextEdit_method_has_redo:
  1593. .. rst-class:: classref-method
  1594. :ref:`bool<class_bool>` **has_redo** **(** **)** |const|
  1595. Returns ``true`` if a "redo" action is available.
  1596. .. rst-class:: classref-item-separator
  1597. ----
  1598. .. _class_TextEdit_method_has_selection:
  1599. .. rst-class:: classref-method
  1600. :ref:`bool<class_bool>` **has_selection** **(** :ref:`int<class_int>` caret_index=-1 **)** |const|
  1601. Returns ``true`` if the user has selected text.
  1602. .. rst-class:: classref-item-separator
  1603. ----
  1604. .. _class_TextEdit_method_has_undo:
  1605. .. rst-class:: classref-method
  1606. :ref:`bool<class_bool>` **has_undo** **(** **)** |const|
  1607. Returns ``true`` if an "undo" action is available.
  1608. .. rst-class:: classref-item-separator
  1609. ----
  1610. .. _class_TextEdit_method_insert_line_at:
  1611. .. rst-class:: classref-method
  1612. void **insert_line_at** **(** :ref:`int<class_int>` line, :ref:`String<class_String>` text **)**
  1613. Inserts a new line with ``text`` at ``line``.
  1614. .. rst-class:: classref-item-separator
  1615. ----
  1616. .. _class_TextEdit_method_insert_text_at_caret:
  1617. .. rst-class:: classref-method
  1618. void **insert_text_at_caret** **(** :ref:`String<class_String>` text, :ref:`int<class_int>` caret_index=-1 **)**
  1619. Insert the specified text at the caret position.
  1620. .. rst-class:: classref-item-separator
  1621. ----
  1622. .. _class_TextEdit_method_is_caret_visible:
  1623. .. rst-class:: classref-method
  1624. :ref:`bool<class_bool>` **is_caret_visible** **(** :ref:`int<class_int>` caret_index=0 **)** |const|
  1625. Returns ``true`` if the caret is visible on the screen.
  1626. .. rst-class:: classref-item-separator
  1627. ----
  1628. .. _class_TextEdit_method_is_dragging_cursor:
  1629. .. rst-class:: classref-method
  1630. :ref:`bool<class_bool>` **is_dragging_cursor** **(** **)** |const|
  1631. Returns ``true`` if the user is dragging their mouse for scrolling or selecting.
  1632. .. rst-class:: classref-item-separator
  1633. ----
  1634. .. _class_TextEdit_method_is_gutter_clickable:
  1635. .. rst-class:: classref-method
  1636. :ref:`bool<class_bool>` **is_gutter_clickable** **(** :ref:`int<class_int>` gutter **)** |const|
  1637. Returns whether the gutter is clickable.
  1638. .. rst-class:: classref-item-separator
  1639. ----
  1640. .. _class_TextEdit_method_is_gutter_drawn:
  1641. .. rst-class:: classref-method
  1642. :ref:`bool<class_bool>` **is_gutter_drawn** **(** :ref:`int<class_int>` gutter **)** |const|
  1643. Returns whether the gutter is currently drawn.
  1644. .. rst-class:: classref-item-separator
  1645. ----
  1646. .. _class_TextEdit_method_is_gutter_overwritable:
  1647. .. rst-class:: classref-method
  1648. :ref:`bool<class_bool>` **is_gutter_overwritable** **(** :ref:`int<class_int>` gutter **)** |const|
  1649. Returns whether the gutter is overwritable.
  1650. .. rst-class:: classref-item-separator
  1651. ----
  1652. .. _class_TextEdit_method_is_line_gutter_clickable:
  1653. .. rst-class:: classref-method
  1654. :ref:`bool<class_bool>` **is_line_gutter_clickable** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
  1655. Returns whether the gutter on the given line is clickable.
  1656. .. rst-class:: classref-item-separator
  1657. ----
  1658. .. _class_TextEdit_method_is_line_wrapped:
  1659. .. rst-class:: classref-method
  1660. :ref:`bool<class_bool>` **is_line_wrapped** **(** :ref:`int<class_int>` line **)** |const|
  1661. Returns if the given line is wrapped.
  1662. .. rst-class:: classref-item-separator
  1663. ----
  1664. .. _class_TextEdit_method_is_menu_visible:
  1665. .. rst-class:: classref-method
  1666. :ref:`bool<class_bool>` **is_menu_visible** **(** **)** |const|
  1667. Returns whether the menu is visible. Use this instead of ``get_menu().visible`` to improve performance (so the creation of the menu is avoided).
  1668. .. rst-class:: classref-item-separator
  1669. ----
  1670. .. _class_TextEdit_method_is_mouse_over_selection:
  1671. .. rst-class:: classref-method
  1672. :ref:`bool<class_bool>` **is_mouse_over_selection** **(** :ref:`bool<class_bool>` edges, :ref:`int<class_int>` caret_index=-1 **)** |const|
  1673. Returns whether the mouse is over selection. If ``edges`` is ``true``, the edges are considered part of the selection.
  1674. .. rst-class:: classref-item-separator
  1675. ----
  1676. .. _class_TextEdit_method_is_overtype_mode_enabled:
  1677. .. rst-class:: classref-method
  1678. :ref:`bool<class_bool>` **is_overtype_mode_enabled** **(** **)** |const|
  1679. Returns whether the user is in overtype mode.
  1680. .. rst-class:: classref-item-separator
  1681. ----
  1682. .. _class_TextEdit_method_menu_option:
  1683. .. rst-class:: classref-method
  1684. void **menu_option** **(** :ref:`int<class_int>` option **)**
  1685. Executes a given action as defined in the :ref:`MenuItems<enum_TextEdit_MenuItems>` enum.
  1686. .. rst-class:: classref-item-separator
  1687. ----
  1688. .. _class_TextEdit_method_merge_gutters:
  1689. .. rst-class:: classref-method
  1690. void **merge_gutters** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)**
  1691. Merge the gutters from ``from_line`` into ``to_line``. Only overwritable gutters will be copied.
  1692. .. rst-class:: classref-item-separator
  1693. ----
  1694. .. _class_TextEdit_method_merge_overlapping_carets:
  1695. .. rst-class:: classref-method
  1696. void **merge_overlapping_carets** **(** **)**
  1697. Merges any overlapping carets. Will favor the newest caret, or the caret with a selection.
  1698. \ **Note:** This is not called when a caret changes position but after certain actions, so it is possible to get into a state where carets overlap.
  1699. .. rst-class:: classref-item-separator
  1700. ----
  1701. .. _class_TextEdit_method_paste:
  1702. .. rst-class:: classref-method
  1703. void **paste** **(** :ref:`int<class_int>` caret_index=-1 **)**
  1704. Paste at the current location. Can be overridden with :ref:`_paste<class_TextEdit_private_method__paste>`.
  1705. .. rst-class:: classref-item-separator
  1706. ----
  1707. .. _class_TextEdit_method_paste_primary_clipboard:
  1708. .. rst-class:: classref-method
  1709. void **paste_primary_clipboard** **(** :ref:`int<class_int>` caret_index=-1 **)**
  1710. Pastes the primary clipboard.
  1711. .. rst-class:: classref-item-separator
  1712. ----
  1713. .. _class_TextEdit_method_redo:
  1714. .. rst-class:: classref-method
  1715. void **redo** **(** **)**
  1716. Perform redo operation.
  1717. .. rst-class:: classref-item-separator
  1718. ----
  1719. .. _class_TextEdit_method_remove_caret:
  1720. .. rst-class:: classref-method
  1721. void **remove_caret** **(** :ref:`int<class_int>` caret **)**
  1722. Removes the given caret index.
  1723. \ **Note:** This can result in adjustment of all other caret indices.
  1724. .. rst-class:: classref-item-separator
  1725. ----
  1726. .. _class_TextEdit_method_remove_gutter:
  1727. .. rst-class:: classref-method
  1728. void **remove_gutter** **(** :ref:`int<class_int>` gutter **)**
  1729. Removes the gutter from this **TextEdit**.
  1730. .. rst-class:: classref-item-separator
  1731. ----
  1732. .. _class_TextEdit_method_remove_secondary_carets:
  1733. .. rst-class:: classref-method
  1734. void **remove_secondary_carets** **(** **)**
  1735. Removes all additional carets.
  1736. .. rst-class:: classref-item-separator
  1737. ----
  1738. .. _class_TextEdit_method_remove_text:
  1739. .. rst-class:: classref-method
  1740. void **remove_text** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_column **)**
  1741. Removes text between the given positions.
  1742. \ **Note:** This does not adjust the caret or selection, which as a result it can end up in an invalid position.
  1743. .. rst-class:: classref-item-separator
  1744. ----
  1745. .. _class_TextEdit_method_search:
  1746. .. rst-class:: classref-method
  1747. :ref:`Vector2i<class_Vector2i>` **search** **(** :ref:`String<class_String>` text, :ref:`int<class_int>` flags, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_colum **)** |const|
  1748. Perform a search inside the text. Search flags can be specified in the :ref:`SearchFlags<enum_TextEdit_SearchFlags>` enum.
  1749. In the returned vector, ``x`` is the column, ``y`` is the line. If no results are found, both are equal to ``-1``.
  1750. .. tabs::
  1751. .. code-tab:: gdscript
  1752. var result = search("print", SEARCH_WHOLE_WORDS, 0, 0)
  1753. if result.x != -1:
  1754. # Result found.
  1755. var line_number = result.y
  1756. var column_number = result.x
  1757. .. code-tab:: csharp
  1758. Vector2I result = Search("print", (uint)TextEdit.SearchFlags.WholeWords, 0, 0);
  1759. if (result.X != -1)
  1760. {
  1761. // Result found.
  1762. int lineNumber = result.Y;
  1763. int columnNumber = result.X;
  1764. }
  1765. .. rst-class:: classref-item-separator
  1766. ----
  1767. .. _class_TextEdit_method_select:
  1768. .. rst-class:: classref-method
  1769. 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, :ref:`int<class_int>` caret_index=0 **)**
  1770. Perform selection, from line/column to line/column.
  1771. If :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` is ``false``, no selection will occur.
  1772. .. rst-class:: classref-item-separator
  1773. ----
  1774. .. _class_TextEdit_method_select_all:
  1775. .. rst-class:: classref-method
  1776. void **select_all** **(** **)**
  1777. Select all the text.
  1778. If :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` is ``false``, no selection will occur.
  1779. .. rst-class:: classref-item-separator
  1780. ----
  1781. .. _class_TextEdit_method_select_word_under_caret:
  1782. .. rst-class:: classref-method
  1783. void **select_word_under_caret** **(** :ref:`int<class_int>` caret_index=-1 **)**
  1784. Selects the word under the caret.
  1785. .. rst-class:: classref-item-separator
  1786. ----
  1787. .. _class_TextEdit_method_set_caret_column:
  1788. .. rst-class:: classref-method
  1789. void **set_caret_column** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true, :ref:`int<class_int>` caret_index=0 **)**
  1790. Moves the caret to the specified ``column`` index.
  1791. If ``adjust_viewport`` is ``true``, the viewport will center at the caret position after the move occurs.
  1792. \ **Note:** If supporting multiple carets this will not check for any overlap. See :ref:`merge_overlapping_carets<class_TextEdit_method_merge_overlapping_carets>`.
  1793. .. rst-class:: classref-item-separator
  1794. ----
  1795. .. _class_TextEdit_method_set_caret_line:
  1796. .. rst-class:: classref-method
  1797. void **set_caret_line** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` adjust_viewport=true, :ref:`bool<class_bool>` can_be_hidden=true, :ref:`int<class_int>` wrap_index=0, :ref:`int<class_int>` caret_index=0 **)**
  1798. Moves the caret to the specified ``line`` index.
  1799. If ``adjust_viewport`` is ``true``, the viewport will center at the caret position after the move occurs.
  1800. If ``can_be_hidden`` is ``true``, the specified ``line`` can be hidden.
  1801. \ **Note:** If supporting multiple carets this will not check for any overlap. See :ref:`merge_overlapping_carets<class_TextEdit_method_merge_overlapping_carets>`.
  1802. .. rst-class:: classref-item-separator
  1803. ----
  1804. .. _class_TextEdit_method_set_gutter_clickable:
  1805. .. rst-class:: classref-method
  1806. void **set_gutter_clickable** **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` clickable **)**
  1807. Sets the gutter as clickable. This will change the mouse cursor to a pointing hand when hovering over the gutter.
  1808. .. rst-class:: classref-item-separator
  1809. ----
  1810. .. _class_TextEdit_method_set_gutter_custom_draw:
  1811. .. rst-class:: classref-method
  1812. void **set_gutter_custom_draw** **(** :ref:`int<class_int>` column, :ref:`Callable<class_Callable>` draw_callback **)**
  1813. Set a custom draw method for the gutter. The callback method must take the following args: ``line: int, gutter: int, Area: Rect2``.
  1814. .. rst-class:: classref-item-separator
  1815. ----
  1816. .. _class_TextEdit_method_set_gutter_draw:
  1817. .. rst-class:: classref-method
  1818. void **set_gutter_draw** **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` draw **)**
  1819. Sets whether the gutter should be drawn.
  1820. .. rst-class:: classref-item-separator
  1821. ----
  1822. .. _class_TextEdit_method_set_gutter_name:
  1823. .. rst-class:: classref-method
  1824. void **set_gutter_name** **(** :ref:`int<class_int>` gutter, :ref:`String<class_String>` name **)**
  1825. Sets the name of the gutter.
  1826. .. rst-class:: classref-item-separator
  1827. ----
  1828. .. _class_TextEdit_method_set_gutter_overwritable:
  1829. .. rst-class:: classref-method
  1830. void **set_gutter_overwritable** **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` overwritable **)**
  1831. Sets the gutter to overwritable. See :ref:`merge_gutters<class_TextEdit_method_merge_gutters>`.
  1832. .. rst-class:: classref-item-separator
  1833. ----
  1834. .. _class_TextEdit_method_set_gutter_type:
  1835. .. rst-class:: classref-method
  1836. void **set_gutter_type** **(** :ref:`int<class_int>` gutter, :ref:`GutterType<enum_TextEdit_GutterType>` type **)**
  1837. Sets the type of gutter.
  1838. .. rst-class:: classref-item-separator
  1839. ----
  1840. .. _class_TextEdit_method_set_gutter_width:
  1841. .. rst-class:: classref-method
  1842. void **set_gutter_width** **(** :ref:`int<class_int>` gutter, :ref:`int<class_int>` width **)**
  1843. Set the width of the gutter.
  1844. .. rst-class:: classref-item-separator
  1845. ----
  1846. .. _class_TextEdit_method_set_line:
  1847. .. rst-class:: classref-method
  1848. void **set_line** **(** :ref:`int<class_int>` line, :ref:`String<class_String>` new_text **)**
  1849. Sets the text for a specific line.
  1850. .. rst-class:: classref-item-separator
  1851. ----
  1852. .. _class_TextEdit_method_set_line_as_center_visible:
  1853. .. rst-class:: classref-method
  1854. void **set_line_as_center_visible** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)**
  1855. Positions the ``wrap_index`` of ``line`` at the center of the viewport.
  1856. .. rst-class:: classref-item-separator
  1857. ----
  1858. .. _class_TextEdit_method_set_line_as_first_visible:
  1859. .. rst-class:: classref-method
  1860. void **set_line_as_first_visible** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)**
  1861. Positions the ``wrap_index`` of ``line`` at the top of the viewport.
  1862. .. rst-class:: classref-item-separator
  1863. ----
  1864. .. _class_TextEdit_method_set_line_as_last_visible:
  1865. .. rst-class:: classref-method
  1866. void **set_line_as_last_visible** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)**
  1867. Positions the ``wrap_index`` of ``line`` at the bottom of the viewport.
  1868. .. rst-class:: classref-item-separator
  1869. ----
  1870. .. _class_TextEdit_method_set_line_background_color:
  1871. .. rst-class:: classref-method
  1872. void **set_line_background_color** **(** :ref:`int<class_int>` line, :ref:`Color<class_Color>` color **)**
  1873. Sets the current background color of the line. Set to ``Color(0, 0, 0, 0)`` for no color.
  1874. .. rst-class:: classref-item-separator
  1875. ----
  1876. .. _class_TextEdit_method_set_line_gutter_clickable:
  1877. .. rst-class:: classref-method
  1878. void **set_line_gutter_clickable** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` clickable **)**
  1879. If ``clickable`` is ``true``, makes the ``gutter`` on ``line`` clickable. See :ref:`gutter_clicked<class_TextEdit_signal_gutter_clicked>`.
  1880. .. rst-class:: classref-item-separator
  1881. ----
  1882. .. _class_TextEdit_method_set_line_gutter_icon:
  1883. .. rst-class:: classref-method
  1884. void **set_line_gutter_icon** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Texture2D<class_Texture2D>` icon **)**
  1885. Sets the icon for ``gutter`` on ``line`` to ``icon``.
  1886. .. rst-class:: classref-item-separator
  1887. ----
  1888. .. _class_TextEdit_method_set_line_gutter_item_color:
  1889. .. rst-class:: classref-method
  1890. void **set_line_gutter_item_color** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Color<class_Color>` color **)**
  1891. Sets the color for ``gutter`` on ``line`` to ``color``.
  1892. .. rst-class:: classref-item-separator
  1893. ----
  1894. .. _class_TextEdit_method_set_line_gutter_metadata:
  1895. .. rst-class:: classref-method
  1896. void **set_line_gutter_metadata** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Variant<class_Variant>` metadata **)**
  1897. Sets the metadata for ``gutter`` on ``line`` to ``metadata``.
  1898. .. rst-class:: classref-item-separator
  1899. ----
  1900. .. _class_TextEdit_method_set_line_gutter_text:
  1901. .. rst-class:: classref-method
  1902. void **set_line_gutter_text** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`String<class_String>` text **)**
  1903. Sets the text for ``gutter`` on ``line`` to ``text``.
  1904. .. rst-class:: classref-item-separator
  1905. ----
  1906. .. _class_TextEdit_method_set_overtype_mode_enabled:
  1907. .. rst-class:: classref-method
  1908. void **set_overtype_mode_enabled** **(** :ref:`bool<class_bool>` enabled **)**
  1909. If ``true``, sets the user into overtype mode. When the user types in this mode, it will override existing text.
  1910. .. rst-class:: classref-item-separator
  1911. ----
  1912. .. _class_TextEdit_method_set_search_flags:
  1913. .. rst-class:: classref-method
  1914. void **set_search_flags** **(** :ref:`int<class_int>` flags **)**
  1915. Sets the search ``flags``. This is used with :ref:`set_search_text<class_TextEdit_method_set_search_text>` to highlight occurrences of the searched text. Search flags can be specified from the :ref:`SearchFlags<enum_TextEdit_SearchFlags>` enum.
  1916. .. rst-class:: classref-item-separator
  1917. ----
  1918. .. _class_TextEdit_method_set_search_text:
  1919. .. rst-class:: classref-method
  1920. void **set_search_text** **(** :ref:`String<class_String>` search_text **)**
  1921. Sets the search text. See :ref:`set_search_flags<class_TextEdit_method_set_search_flags>`.
  1922. .. rst-class:: classref-item-separator
  1923. ----
  1924. .. _class_TextEdit_method_set_selection_mode:
  1925. .. rst-class:: classref-method
  1926. void **set_selection_mode** **(** :ref:`SelectionMode<enum_TextEdit_SelectionMode>` mode, :ref:`int<class_int>` line=-1, :ref:`int<class_int>` column=-1, :ref:`int<class_int>` caret_index=0 **)**
  1927. Sets the current selection mode.
  1928. .. rst-class:: classref-item-separator
  1929. ----
  1930. .. _class_TextEdit_method_set_tab_size:
  1931. .. rst-class:: classref-method
  1932. void **set_tab_size** **(** :ref:`int<class_int>` size **)**
  1933. Sets the tab size for the **TextEdit** to use.
  1934. .. rst-class:: classref-item-separator
  1935. ----
  1936. .. _class_TextEdit_method_set_tooltip_request_func:
  1937. .. rst-class:: classref-method
  1938. void **set_tooltip_request_func** **(** :ref:`Callable<class_Callable>` callback **)**
  1939. Provide custom tooltip text. The callback method must take the following args: ``hovered_word: String``.
  1940. .. rst-class:: classref-item-separator
  1941. ----
  1942. .. _class_TextEdit_method_start_action:
  1943. .. rst-class:: classref-method
  1944. void **start_action** **(** :ref:`EditAction<enum_TextEdit_EditAction>` action **)**
  1945. Starts an action, will end the current action if ``action`` is different.
  1946. An action will also end after a call to :ref:`end_action<class_TextEdit_method_end_action>`, after :ref:`ProjectSettings.gui/timers/text_edit_idle_detect_sec<class_ProjectSettings_property_gui/timers/text_edit_idle_detect_sec>` is triggered or a new undoable step outside the :ref:`start_action<class_TextEdit_method_start_action>` and :ref:`end_action<class_TextEdit_method_end_action>` calls.
  1947. .. rst-class:: classref-item-separator
  1948. ----
  1949. .. _class_TextEdit_method_swap_lines:
  1950. .. rst-class:: classref-method
  1951. void **swap_lines** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)**
  1952. Swaps the two lines.
  1953. .. rst-class:: classref-item-separator
  1954. ----
  1955. .. _class_TextEdit_method_tag_saved_version:
  1956. .. rst-class:: classref-method
  1957. void **tag_saved_version** **(** **)**
  1958. Tag the current version as saved.
  1959. .. rst-class:: classref-item-separator
  1960. ----
  1961. .. _class_TextEdit_method_undo:
  1962. .. rst-class:: classref-method
  1963. void **undo** **(** **)**
  1964. Perform undo operation.
  1965. .. rst-class:: classref-section-separator
  1966. ----
  1967. .. rst-class:: classref-descriptions-group
  1968. Theme Property Descriptions
  1969. ---------------------------
  1970. .. _class_TextEdit_theme_color_background_color:
  1971. .. rst-class:: classref-themeproperty
  1972. :ref:`Color<class_Color>` **background_color** = ``Color(0, 0, 0, 0)``
  1973. Sets the background :ref:`Color<class_Color>` of this **TextEdit**.
  1974. .. rst-class:: classref-item-separator
  1975. ----
  1976. .. _class_TextEdit_theme_color_caret_background_color:
  1977. .. rst-class:: classref-themeproperty
  1978. :ref:`Color<class_Color>` **caret_background_color** = ``Color(0, 0, 0, 1)``
  1979. :ref:`Color<class_Color>` of the text behind the caret when using a block caret.
  1980. .. rst-class:: classref-item-separator
  1981. ----
  1982. .. _class_TextEdit_theme_color_caret_color:
  1983. .. rst-class:: classref-themeproperty
  1984. :ref:`Color<class_Color>` **caret_color** = ``Color(0.875, 0.875, 0.875, 1)``
  1985. :ref:`Color<class_Color>` of the caret. This can be set to a fully transparent color to hide the caret entirely.
  1986. .. rst-class:: classref-item-separator
  1987. ----
  1988. .. _class_TextEdit_theme_color_current_line_color:
  1989. .. rst-class:: classref-themeproperty
  1990. :ref:`Color<class_Color>` **current_line_color** = ``Color(0.25, 0.25, 0.26, 0.8)``
  1991. Background :ref:`Color<class_Color>` of the line containing the caret.
  1992. .. rst-class:: classref-item-separator
  1993. ----
  1994. .. _class_TextEdit_theme_color_font_color:
  1995. .. rst-class:: classref-themeproperty
  1996. :ref:`Color<class_Color>` **font_color** = ``Color(0.875, 0.875, 0.875, 1)``
  1997. Sets the font :ref:`Color<class_Color>`.
  1998. .. rst-class:: classref-item-separator
  1999. ----
  2000. .. _class_TextEdit_theme_color_font_outline_color:
  2001. .. rst-class:: classref-themeproperty
  2002. :ref:`Color<class_Color>` **font_outline_color** = ``Color(1, 1, 1, 1)``
  2003. The tint of text outline of the **TextEdit**.
  2004. .. rst-class:: classref-item-separator
  2005. ----
  2006. .. _class_TextEdit_theme_color_font_placeholder_color:
  2007. .. rst-class:: classref-themeproperty
  2008. :ref:`Color<class_Color>` **font_placeholder_color** = ``Color(0.875, 0.875, 0.875, 0.6)``
  2009. Font color for :ref:`placeholder_text<class_TextEdit_property_placeholder_text>`.
  2010. .. rst-class:: classref-item-separator
  2011. ----
  2012. .. _class_TextEdit_theme_color_font_readonly_color:
  2013. .. rst-class:: classref-themeproperty
  2014. :ref:`Color<class_Color>` **font_readonly_color** = ``Color(0.875, 0.875, 0.875, 0.5)``
  2015. Sets the font :ref:`Color<class_Color>` when :ref:`editable<class_TextEdit_property_editable>` is disabled.
  2016. .. rst-class:: classref-item-separator
  2017. ----
  2018. .. _class_TextEdit_theme_color_font_selected_color:
  2019. .. rst-class:: classref-themeproperty
  2020. :ref:`Color<class_Color>` **font_selected_color** = ``Color(0, 0, 0, 0)``
  2021. Sets the :ref:`Color<class_Color>` of the selected text. If equal to ``Color(0, 0, 0, 0)``, it will be ignored.
  2022. .. rst-class:: classref-item-separator
  2023. ----
  2024. .. _class_TextEdit_theme_color_search_result_border_color:
  2025. .. rst-class:: classref-themeproperty
  2026. :ref:`Color<class_Color>` **search_result_border_color** = ``Color(0.3, 0.3, 0.3, 0.4)``
  2027. :ref:`Color<class_Color>` of the border around text that matches the search query.
  2028. .. rst-class:: classref-item-separator
  2029. ----
  2030. .. _class_TextEdit_theme_color_search_result_color:
  2031. .. rst-class:: classref-themeproperty
  2032. :ref:`Color<class_Color>` **search_result_color** = ``Color(0.3, 0.3, 0.3, 1)``
  2033. :ref:`Color<class_Color>` behind the text that matches the search query.
  2034. .. rst-class:: classref-item-separator
  2035. ----
  2036. .. _class_TextEdit_theme_color_selection_color:
  2037. .. rst-class:: classref-themeproperty
  2038. :ref:`Color<class_Color>` **selection_color** = ``Color(0.5, 0.5, 0.5, 1)``
  2039. Sets the highlight :ref:`Color<class_Color>` of text selections.
  2040. .. rst-class:: classref-item-separator
  2041. ----
  2042. .. _class_TextEdit_theme_color_word_highlighted_color:
  2043. .. rst-class:: classref-themeproperty
  2044. :ref:`Color<class_Color>` **word_highlighted_color** = ``Color(0.5, 0.5, 0.5, 0.25)``
  2045. Sets the highlight :ref:`Color<class_Color>` of multiple occurrences. :ref:`highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` has to be enabled.
  2046. .. rst-class:: classref-item-separator
  2047. ----
  2048. .. _class_TextEdit_theme_constant_caret_width:
  2049. .. rst-class:: classref-themeproperty
  2050. :ref:`int<class_int>` **caret_width** = ``1``
  2051. The caret's width in pixels. Greater values can be used to improve accessibility by ensuring the caret is easily visible, or to ensure consistency with a large font size. If set to ``0`` or lower, the caret width is automatically set to 1 pixel and multiplied by the display scaling factor.
  2052. .. rst-class:: classref-item-separator
  2053. ----
  2054. .. _class_TextEdit_theme_constant_line_spacing:
  2055. .. rst-class:: classref-themeproperty
  2056. :ref:`int<class_int>` **line_spacing** = ``4``
  2057. Sets the spacing between the lines.
  2058. .. rst-class:: classref-item-separator
  2059. ----
  2060. .. _class_TextEdit_theme_constant_outline_size:
  2061. .. rst-class:: classref-themeproperty
  2062. :ref:`int<class_int>` **outline_size** = ``0``
  2063. The size of the text outline.
  2064. \ **Note:** If using a font with :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` enabled, its :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the value of :ref:`outline_size<class_TextEdit_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
  2065. .. rst-class:: classref-item-separator
  2066. ----
  2067. .. _class_TextEdit_theme_font_font:
  2068. .. rst-class:: classref-themeproperty
  2069. :ref:`Font<class_Font>` **font**
  2070. Sets the default :ref:`Font<class_Font>`.
  2071. .. rst-class:: classref-item-separator
  2072. ----
  2073. .. _class_TextEdit_theme_font_size_font_size:
  2074. .. rst-class:: classref-themeproperty
  2075. :ref:`int<class_int>` **font_size**
  2076. Sets default font size.
  2077. .. rst-class:: classref-item-separator
  2078. ----
  2079. .. _class_TextEdit_theme_icon_space:
  2080. .. rst-class:: classref-themeproperty
  2081. :ref:`Texture2D<class_Texture2D>` **space**
  2082. Sets a custom :ref:`Texture2D<class_Texture2D>` for space text characters.
  2083. .. rst-class:: classref-item-separator
  2084. ----
  2085. .. _class_TextEdit_theme_icon_tab:
  2086. .. rst-class:: classref-themeproperty
  2087. :ref:`Texture2D<class_Texture2D>` **tab**
  2088. Sets a custom :ref:`Texture2D<class_Texture2D>` for tab text characters.
  2089. .. rst-class:: classref-item-separator
  2090. ----
  2091. .. _class_TextEdit_theme_style_focus:
  2092. .. rst-class:: classref-themeproperty
  2093. :ref:`StyleBox<class_StyleBox>` **focus**
  2094. Sets the :ref:`StyleBox<class_StyleBox>` when in focus. The :ref:`focus<class_TextEdit_theme_style_focus>` :ref:`StyleBox<class_StyleBox>` is displayed *over* the base :ref:`StyleBox<class_StyleBox>`, so a partially transparent :ref:`StyleBox<class_StyleBox>` should be used to ensure the base :ref:`StyleBox<class_StyleBox>` remains visible. A :ref:`StyleBox<class_StyleBox>` that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
  2095. .. rst-class:: classref-item-separator
  2096. ----
  2097. .. _class_TextEdit_theme_style_normal:
  2098. .. rst-class:: classref-themeproperty
  2099. :ref:`StyleBox<class_StyleBox>` **normal**
  2100. Sets the :ref:`StyleBox<class_StyleBox>` of this **TextEdit**.
  2101. .. rst-class:: classref-item-separator
  2102. ----
  2103. .. _class_TextEdit_theme_style_read_only:
  2104. .. rst-class:: classref-themeproperty
  2105. :ref:`StyleBox<class_StyleBox>` **read_only**
  2106. Sets the :ref:`StyleBox<class_StyleBox>` of this **TextEdit** when :ref:`editable<class_TextEdit_property_editable>` is disabled.
  2107. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  2108. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  2109. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  2110. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  2111. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  2112. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  2113. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`