class_textedit.rst 210 KB

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