class_textedit.rst 254 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160
  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 in the order they were created.
  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:`String<class_String>` | :ref:`custom_word_separators<class_TextEdit_property_custom_word_separators>` | ``""`` |
  47. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  48. | :ref:`bool<class_bool>` | :ref:`deselect_on_focus_loss_enabled<class_TextEdit_property_deselect_on_focus_loss_enabled>` | ``true`` |
  49. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  50. | :ref:`bool<class_bool>` | :ref:`drag_and_drop_selection_enabled<class_TextEdit_property_drag_and_drop_selection_enabled>` | ``true`` |
  51. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  52. | :ref:`bool<class_bool>` | :ref:`draw_control_chars<class_TextEdit_property_draw_control_chars>` | ``false`` |
  53. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  54. | :ref:`bool<class_bool>` | :ref:`draw_spaces<class_TextEdit_property_draw_spaces>` | ``false`` |
  55. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  56. | :ref:`bool<class_bool>` | :ref:`draw_tabs<class_TextEdit_property_draw_tabs>` | ``false`` |
  57. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`editable<class_TextEdit_property_editable>` | ``true`` |
  59. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  60. | :ref:`bool<class_bool>` | :ref:`empty_selection_clipboard_enabled<class_TextEdit_property_empty_selection_clipboard_enabled>` | ``true`` |
  61. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  62. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  63. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` | ``false`` |
  65. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  66. | :ref:`bool<class_bool>` | :ref:`highlight_current_line<class_TextEdit_property_highlight_current_line>` | ``false`` |
  67. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  68. | :ref:`bool<class_bool>` | :ref:`indent_wrapped_lines<class_TextEdit_property_indent_wrapped_lines>` | ``false`` |
  69. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  70. | :ref:`String<class_String>` | :ref:`language<class_TextEdit_property_language>` | ``""`` |
  71. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  72. | :ref:`bool<class_bool>` | :ref:`middle_mouse_paste_enabled<class_TextEdit_property_middle_mouse_paste_enabled>` | ``true`` |
  73. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  74. | :ref:`bool<class_bool>` | :ref:`minimap_draw<class_TextEdit_property_minimap_draw>` | ``false`` |
  75. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  76. | :ref:`int<class_int>` | :ref:`minimap_width<class_TextEdit_property_minimap_width>` | ``80`` |
  77. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  78. | :ref:`CursorShape<enum_Control_CursorShape>` | mouse_default_cursor_shape | ``1`` (overrides :ref:`Control<class_Control_property_mouse_default_cursor_shape>`) |
  79. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  80. | :ref:`String<class_String>` | :ref:`placeholder_text<class_TextEdit_property_placeholder_text>` | ``""`` |
  81. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  82. | :ref:`bool<class_bool>` | :ref:`scroll_fit_content_height<class_TextEdit_property_scroll_fit_content_height>` | ``false`` |
  83. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  84. | :ref:`bool<class_bool>` | :ref:`scroll_fit_content_width<class_TextEdit_property_scroll_fit_content_width>` | ``false`` |
  85. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  86. | :ref:`int<class_int>` | :ref:`scroll_horizontal<class_TextEdit_property_scroll_horizontal>` | ``0`` |
  87. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  88. | :ref:`bool<class_bool>` | :ref:`scroll_past_end_of_file<class_TextEdit_property_scroll_past_end_of_file>` | ``false`` |
  89. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  90. | :ref:`bool<class_bool>` | :ref:`scroll_smooth<class_TextEdit_property_scroll_smooth>` | ``false`` |
  91. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  92. | :ref:`float<class_float>` | :ref:`scroll_v_scroll_speed<class_TextEdit_property_scroll_v_scroll_speed>` | ``80.0`` |
  93. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  94. | :ref:`float<class_float>` | :ref:`scroll_vertical<class_TextEdit_property_scroll_vertical>` | ``0.0`` |
  95. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  96. | :ref:`bool<class_bool>` | :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` | ``true`` |
  97. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  98. | :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_TextEdit_property_shortcut_keys_enabled>` | ``true`` |
  99. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  100. | :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_TextEdit_property_structured_text_bidi_override>` | ``0`` |
  101. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  102. | :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_TextEdit_property_structured_text_bidi_override_options>` | ``[]`` |
  103. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  104. | :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` | :ref:`syntax_highlighter<class_TextEdit_property_syntax_highlighter>` | |
  105. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  106. | :ref:`String<class_String>` | :ref:`text<class_TextEdit_property_text>` | ``""`` |
  107. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  108. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_TextEdit_property_text_direction>` | ``0`` |
  109. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  110. | :ref:`bool<class_bool>` | :ref:`use_custom_word_separators<class_TextEdit_property_use_custom_word_separators>` | ``false`` |
  111. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  112. | :ref:`bool<class_bool>` | :ref:`use_default_word_separators<class_TextEdit_property_use_default_word_separators>` | ``true`` |
  113. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  114. | :ref:`bool<class_bool>` | :ref:`virtual_keyboard_enabled<class_TextEdit_property_virtual_keyboard_enabled>` | ``true`` |
  115. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  116. | :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` | :ref:`wrap_mode<class_TextEdit_property_wrap_mode>` | ``0`` |
  117. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  118. .. rst-class:: classref-reftable-group
  119. Methods
  120. -------
  121. .. table::
  122. :widths: auto
  123. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | |void| | :ref:`_backspace<class_TextEdit_private_method__backspace>`\ (\ caret_index\: :ref:`int<class_int>`\ ) |virtual| |
  125. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | |void| | :ref:`_copy<class_TextEdit_private_method__copy>`\ (\ caret_index\: :ref:`int<class_int>`\ ) |virtual| |
  127. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | |void| | :ref:`_cut<class_TextEdit_private_method__cut>`\ (\ caret_index\: :ref:`int<class_int>`\ ) |virtual| |
  129. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | |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| |
  131. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | |void| | :ref:`_paste<class_TextEdit_private_method__paste>`\ (\ caret_index\: :ref:`int<class_int>`\ ) |virtual| |
  133. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | |void| | :ref:`_paste_primary_clipboard<class_TextEdit_private_method__paste_primary_clipboard>`\ (\ caret_index\: :ref:`int<class_int>`\ ) |virtual| |
  135. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | :ref:`int<class_int>` | :ref:`add_caret<class_TextEdit_method_add_caret>`\ (\ line\: :ref:`int<class_int>`, column\: :ref:`int<class_int>`\ ) |
  137. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | |void| | :ref:`add_caret_at_carets<class_TextEdit_method_add_caret_at_carets>`\ (\ below\: :ref:`bool<class_bool>`\ ) |
  139. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | |void| | :ref:`add_gutter<class_TextEdit_method_add_gutter>`\ (\ at\: :ref:`int<class_int>` = -1\ ) |
  141. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | |void| | :ref:`add_selection_for_next_occurrence<class_TextEdit_method_add_selection_for_next_occurrence>`\ (\ ) |
  143. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | |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>`\ ) |
  145. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | |void| | :ref:`adjust_viewport_to_caret<class_TextEdit_method_adjust_viewport_to_caret>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |
  147. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | |void| | :ref:`apply_ime<class_TextEdit_method_apply_ime>`\ (\ ) |
  149. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | |void| | :ref:`backspace<class_TextEdit_method_backspace>`\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |
  151. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | |void| | :ref:`begin_complex_operation<class_TextEdit_method_begin_complex_operation>`\ (\ ) |
  153. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | |void| | :ref:`begin_multicaret_edit<class_TextEdit_method_begin_multicaret_edit>`\ (\ ) |
  155. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | |void| | :ref:`cancel_ime<class_TextEdit_method_cancel_ime>`\ (\ ) |
  157. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | |void| | :ref:`center_viewport_to_caret<class_TextEdit_method_center_viewport_to_caret>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |
  159. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | |void| | :ref:`clear<class_TextEdit_method_clear>`\ (\ ) |
  161. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | |void| | :ref:`clear_undo_history<class_TextEdit_method_clear_undo_history>`\ (\ ) |
  163. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | |void| | :ref:`collapse_carets<class_TextEdit_method_collapse_carets>`\ (\ from_line\: :ref:`int<class_int>`, from_column\: :ref:`int<class_int>`, to_line\: :ref:`int<class_int>`, to_column\: :ref:`int<class_int>`, inclusive\: :ref:`bool<class_bool>` = false\ ) |
  165. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | |void| | :ref:`copy<class_TextEdit_method_copy>`\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |
  167. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | |void| | :ref:`cut<class_TextEdit_method_cut>`\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |
  169. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | |void| | :ref:`delete_selection<class_TextEdit_method_delete_selection>`\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |
  171. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | |void| | :ref:`deselect<class_TextEdit_method_deselect>`\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |
  173. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | |void| | :ref:`end_action<class_TextEdit_method_end_action>`\ (\ ) |
  175. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | |void| | :ref:`end_complex_operation<class_TextEdit_method_end_complex_operation>`\ (\ ) |
  177. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | |void| | :ref:`end_multicaret_edit<class_TextEdit_method_end_multicaret_edit>`\ (\ ) |
  179. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`int<class_int>` | :ref:`get_caret_column<class_TextEdit_method_get_caret_column>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  181. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | :ref:`int<class_int>` | :ref:`get_caret_count<class_TextEdit_method_get_caret_count>`\ (\ ) |const| |
  183. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | :ref:`Vector2<class_Vector2>` | :ref:`get_caret_draw_pos<class_TextEdit_method_get_caret_draw_pos>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  185. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_caret_index_edit_order<class_TextEdit_method_get_caret_index_edit_order>`\ (\ ) |
  187. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | :ref:`int<class_int>` | :ref:`get_caret_line<class_TextEdit_method_get_caret_line>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  189. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | :ref:`int<class_int>` | :ref:`get_caret_wrap_index<class_TextEdit_method_get_caret_wrap_index>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  191. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | :ref:`int<class_int>` | :ref:`get_first_non_whitespace_column<class_TextEdit_method_get_first_non_whitespace_column>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  193. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | :ref:`int<class_int>` | :ref:`get_first_visible_line<class_TextEdit_method_get_first_visible_line>`\ (\ ) |const| |
  195. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | :ref:`int<class_int>` | :ref:`get_gutter_count<class_TextEdit_method_get_gutter_count>`\ (\ ) |const| |
  197. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | :ref:`String<class_String>` | :ref:`get_gutter_name<class_TextEdit_method_get_gutter_name>`\ (\ gutter\: :ref:`int<class_int>`\ ) |const| |
  199. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | :ref:`GutterType<enum_TextEdit_GutterType>` | :ref:`get_gutter_type<class_TextEdit_method_get_gutter_type>`\ (\ gutter\: :ref:`int<class_int>`\ ) |const| |
  201. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | :ref:`int<class_int>` | :ref:`get_gutter_width<class_TextEdit_method_get_gutter_width>`\ (\ gutter\: :ref:`int<class_int>`\ ) |const| |
  203. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | :ref:`HScrollBar<class_HScrollBar>` | :ref:`get_h_scroll_bar<class_TextEdit_method_get_h_scroll_bar>`\ (\ ) |const| |
  205. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | :ref:`int<class_int>` | :ref:`get_indent_level<class_TextEdit_method_get_indent_level>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  207. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | :ref:`int<class_int>` | :ref:`get_last_full_visible_line<class_TextEdit_method_get_last_full_visible_line>`\ (\ ) |const| |
  209. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | :ref:`int<class_int>` | :ref:`get_last_full_visible_line_wrap_index<class_TextEdit_method_get_last_full_visible_line_wrap_index>`\ (\ ) |const| |
  211. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | :ref:`int<class_int>` | :ref:`get_last_unhidden_line<class_TextEdit_method_get_last_unhidden_line>`\ (\ ) |const| |
  213. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | :ref:`String<class_String>` | :ref:`get_line<class_TextEdit_method_get_line>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  215. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | :ref:`Color<class_Color>` | :ref:`get_line_background_color<class_TextEdit_method_get_line_background_color>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  217. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | :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| |
  219. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | :ref:`int<class_int>` | :ref:`get_line_count<class_TextEdit_method_get_line_count>`\ (\ ) |const| |
  221. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | :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| |
  223. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | :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| |
  225. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | :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| |
  227. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | :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| |
  229. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | :ref:`int<class_int>` | :ref:`get_line_height<class_TextEdit_method_get_line_height>`\ (\ ) |const| |
  231. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | :ref:`Array<class_Array>`\[:ref:`Vector2i<class_Vector2i>`\] | :ref:`get_line_ranges_from_carets<class_TextEdit_method_get_line_ranges_from_carets>`\ (\ only_selections\: :ref:`bool<class_bool>` = false, merge_adjacent\: :ref:`bool<class_bool>` = true\ ) |const| |
  233. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | :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| |
  235. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | :ref:`int<class_int>` | :ref:`get_line_wrap_count<class_TextEdit_method_get_line_wrap_count>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  237. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | :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| |
  239. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_line_wrapped_text<class_TextEdit_method_get_line_wrapped_text>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  241. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | :ref:`Vector2<class_Vector2>` | :ref:`get_local_mouse_pos<class_TextEdit_method_get_local_mouse_pos>`\ (\ ) |const| |
  243. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_TextEdit_method_get_menu>`\ (\ ) |const| |
  245. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | :ref:`int<class_int>` | :ref:`get_minimap_line_at_pos<class_TextEdit_method_get_minimap_line_at_pos>`\ (\ position\: :ref:`Vector2i<class_Vector2i>`\ ) |const| |
  247. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. | :ref:`int<class_int>` | :ref:`get_minimap_visible_lines<class_TextEdit_method_get_minimap_visible_lines>`\ (\ ) |const| |
  249. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  250. | :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| |
  251. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  252. | :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| |
  253. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  254. | :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| |
  255. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  256. | :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| |
  257. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  258. | :ref:`int<class_int>` | :ref:`get_saved_version<class_TextEdit_method_get_saved_version>`\ (\ ) |const| |
  259. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  260. | :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| |
  261. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  262. | :ref:`String<class_String>` | :ref:`get_selected_text<class_TextEdit_method_get_selected_text>`\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |
  263. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  264. | :ref:`int<class_int>` | :ref:`get_selection_at_line_column<class_TextEdit_method_get_selection_at_line_column>`\ (\ line\: :ref:`int<class_int>`, column\: :ref:`int<class_int>`, include_edges\: :ref:`bool<class_bool>` = true, only_selections\: :ref:`bool<class_bool>` = true\ ) |const| |
  265. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  266. | :ref:`int<class_int>` | :ref:`get_selection_column<class_TextEdit_method_get_selection_column>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  267. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  268. | :ref:`int<class_int>` | :ref:`get_selection_from_column<class_TextEdit_method_get_selection_from_column>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  269. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  270. | :ref:`int<class_int>` | :ref:`get_selection_from_line<class_TextEdit_method_get_selection_from_line>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  271. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  272. | :ref:`int<class_int>` | :ref:`get_selection_line<class_TextEdit_method_get_selection_line>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  273. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  274. | :ref:`SelectionMode<enum_TextEdit_SelectionMode>` | :ref:`get_selection_mode<class_TextEdit_method_get_selection_mode>`\ (\ ) |const| |
  275. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  276. | :ref:`int<class_int>` | :ref:`get_selection_origin_column<class_TextEdit_method_get_selection_origin_column>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  277. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  278. | :ref:`int<class_int>` | :ref:`get_selection_origin_line<class_TextEdit_method_get_selection_origin_line>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  279. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  280. | :ref:`int<class_int>` | :ref:`get_selection_to_column<class_TextEdit_method_get_selection_to_column>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  281. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  282. | :ref:`int<class_int>` | :ref:`get_selection_to_line<class_TextEdit_method_get_selection_to_line>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  283. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  284. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_sorted_carets<class_TextEdit_method_get_sorted_carets>`\ (\ include_ignored_carets\: :ref:`bool<class_bool>` = false\ ) |const| |
  285. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  286. | :ref:`int<class_int>` | :ref:`get_tab_size<class_TextEdit_method_get_tab_size>`\ (\ ) |const| |
  287. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  288. | :ref:`int<class_int>` | :ref:`get_total_gutter_width<class_TextEdit_method_get_total_gutter_width>`\ (\ ) |const| |
  289. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  290. | :ref:`int<class_int>` | :ref:`get_total_visible_line_count<class_TextEdit_method_get_total_visible_line_count>`\ (\ ) |const| |
  291. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  292. | :ref:`VScrollBar<class_VScrollBar>` | :ref:`get_v_scroll_bar<class_TextEdit_method_get_v_scroll_bar>`\ (\ ) |const| |
  293. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  294. | :ref:`int<class_int>` | :ref:`get_version<class_TextEdit_method_get_version>`\ (\ ) |const| |
  295. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  296. | :ref:`int<class_int>` | :ref:`get_visible_line_count<class_TextEdit_method_get_visible_line_count>`\ (\ ) |const| |
  297. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  298. | :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| |
  299. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  300. | :ref:`String<class_String>` | :ref:`get_word_at_pos<class_TextEdit_method_get_word_at_pos>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  301. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  302. | :ref:`String<class_String>` | :ref:`get_word_under_caret<class_TextEdit_method_get_word_under_caret>`\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |const| |
  303. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  304. | :ref:`bool<class_bool>` | :ref:`has_ime_text<class_TextEdit_method_has_ime_text>`\ (\ ) |const| |
  305. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  306. | :ref:`bool<class_bool>` | :ref:`has_redo<class_TextEdit_method_has_redo>`\ (\ ) |const| |
  307. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  308. | :ref:`bool<class_bool>` | :ref:`has_selection<class_TextEdit_method_has_selection>`\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |const| |
  309. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  310. | :ref:`bool<class_bool>` | :ref:`has_undo<class_TextEdit_method_has_undo>`\ (\ ) |const| |
  311. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  312. | |void| | :ref:`insert_line_at<class_TextEdit_method_insert_line_at>`\ (\ line\: :ref:`int<class_int>`, text\: :ref:`String<class_String>`\ ) |
  313. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  314. | |void| | :ref:`insert_text<class_TextEdit_method_insert_text>`\ (\ text\: :ref:`String<class_String>`, line\: :ref:`int<class_int>`, column\: :ref:`int<class_int>`, before_selection_begin\: :ref:`bool<class_bool>` = true, before_selection_end\: :ref:`bool<class_bool>` = false\ ) |
  315. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  316. | |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\ ) |
  317. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  318. | :ref:`bool<class_bool>` | :ref:`is_caret_after_selection_origin<class_TextEdit_method_is_caret_after_selection_origin>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  319. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  320. | :ref:`bool<class_bool>` | :ref:`is_caret_visible<class_TextEdit_method_is_caret_visible>`\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| |
  321. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  322. | :ref:`bool<class_bool>` | :ref:`is_dragging_cursor<class_TextEdit_method_is_dragging_cursor>`\ (\ ) |const| |
  323. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  324. | :ref:`bool<class_bool>` | :ref:`is_gutter_clickable<class_TextEdit_method_is_gutter_clickable>`\ (\ gutter\: :ref:`int<class_int>`\ ) |const| |
  325. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  326. | :ref:`bool<class_bool>` | :ref:`is_gutter_drawn<class_TextEdit_method_is_gutter_drawn>`\ (\ gutter\: :ref:`int<class_int>`\ ) |const| |
  327. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  328. | :ref:`bool<class_bool>` | :ref:`is_gutter_overwritable<class_TextEdit_method_is_gutter_overwritable>`\ (\ gutter\: :ref:`int<class_int>`\ ) |const| |
  329. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  330. | :ref:`bool<class_bool>` | :ref:`is_in_mulitcaret_edit<class_TextEdit_method_is_in_mulitcaret_edit>`\ (\ ) |const| |
  331. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  332. | :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| |
  333. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  334. | :ref:`bool<class_bool>` | :ref:`is_line_wrapped<class_TextEdit_method_is_line_wrapped>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  335. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  336. | :ref:`bool<class_bool>` | :ref:`is_menu_visible<class_TextEdit_method_is_menu_visible>`\ (\ ) |const| |
  337. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  338. | :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| |
  339. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  340. | :ref:`bool<class_bool>` | :ref:`is_overtype_mode_enabled<class_TextEdit_method_is_overtype_mode_enabled>`\ (\ ) |const| |
  341. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  342. | |void| | :ref:`menu_option<class_TextEdit_method_menu_option>`\ (\ option\: :ref:`int<class_int>`\ ) |
  343. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  344. | |void| | :ref:`merge_gutters<class_TextEdit_method_merge_gutters>`\ (\ from_line\: :ref:`int<class_int>`, to_line\: :ref:`int<class_int>`\ ) |
  345. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  346. | |void| | :ref:`merge_overlapping_carets<class_TextEdit_method_merge_overlapping_carets>`\ (\ ) |
  347. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  348. | :ref:`bool<class_bool>` | :ref:`multicaret_edit_ignore_caret<class_TextEdit_method_multicaret_edit_ignore_caret>`\ (\ caret_index\: :ref:`int<class_int>`\ ) |const| |
  349. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  350. | |void| | :ref:`paste<class_TextEdit_method_paste>`\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |
  351. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  352. | |void| | :ref:`paste_primary_clipboard<class_TextEdit_method_paste_primary_clipboard>`\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |
  353. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  354. | |void| | :ref:`redo<class_TextEdit_method_redo>`\ (\ ) |
  355. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  356. | |void| | :ref:`remove_caret<class_TextEdit_method_remove_caret>`\ (\ caret\: :ref:`int<class_int>`\ ) |
  357. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  358. | |void| | :ref:`remove_gutter<class_TextEdit_method_remove_gutter>`\ (\ gutter\: :ref:`int<class_int>`\ ) |
  359. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  360. | |void| | :ref:`remove_line_at<class_TextEdit_method_remove_line_at>`\ (\ line\: :ref:`int<class_int>`, move_carets_down\: :ref:`bool<class_bool>` = true\ ) |
  361. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  362. | |void| | :ref:`remove_secondary_carets<class_TextEdit_method_remove_secondary_carets>`\ (\ ) |
  363. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  364. | |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>`\ ) |
  365. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  366. | :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_column\: :ref:`int<class_int>`\ ) |const| |
  367. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  368. | |void| | :ref:`select<class_TextEdit_method_select>`\ (\ origin_line\: :ref:`int<class_int>`, origin_column\: :ref:`int<class_int>`, caret_line\: :ref:`int<class_int>`, caret_column\: :ref:`int<class_int>`, caret_index\: :ref:`int<class_int>` = 0\ ) |
  369. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  370. | |void| | :ref:`select_all<class_TextEdit_method_select_all>`\ (\ ) |
  371. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  372. | |void| | :ref:`select_word_under_caret<class_TextEdit_method_select_word_under_caret>`\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |
  373. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  374. | |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\ ) |
  375. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  376. | |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\ ) |
  377. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  378. | |void| | :ref:`set_gutter_clickable<class_TextEdit_method_set_gutter_clickable>`\ (\ gutter\: :ref:`int<class_int>`, clickable\: :ref:`bool<class_bool>`\ ) |
  379. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  380. | |void| | :ref:`set_gutter_custom_draw<class_TextEdit_method_set_gutter_custom_draw>`\ (\ column\: :ref:`int<class_int>`, draw_callback\: :ref:`Callable<class_Callable>`\ ) |
  381. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  382. | |void| | :ref:`set_gutter_draw<class_TextEdit_method_set_gutter_draw>`\ (\ gutter\: :ref:`int<class_int>`, draw\: :ref:`bool<class_bool>`\ ) |
  383. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  384. | |void| | :ref:`set_gutter_name<class_TextEdit_method_set_gutter_name>`\ (\ gutter\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) |
  385. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  386. | |void| | :ref:`set_gutter_overwritable<class_TextEdit_method_set_gutter_overwritable>`\ (\ gutter\: :ref:`int<class_int>`, overwritable\: :ref:`bool<class_bool>`\ ) |
  387. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  388. | |void| | :ref:`set_gutter_type<class_TextEdit_method_set_gutter_type>`\ (\ gutter\: :ref:`int<class_int>`, type\: :ref:`GutterType<enum_TextEdit_GutterType>`\ ) |
  389. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  390. | |void| | :ref:`set_gutter_width<class_TextEdit_method_set_gutter_width>`\ (\ gutter\: :ref:`int<class_int>`, width\: :ref:`int<class_int>`\ ) |
  391. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  392. | |void| | :ref:`set_line<class_TextEdit_method_set_line>`\ (\ line\: :ref:`int<class_int>`, new_text\: :ref:`String<class_String>`\ ) |
  393. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  394. | |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\ ) |
  395. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  396. | |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\ ) |
  397. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  398. | |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\ ) |
  399. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  400. | |void| | :ref:`set_line_background_color<class_TextEdit_method_set_line_background_color>`\ (\ line\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) |
  401. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  402. | |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>`\ ) |
  403. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  404. | |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>`\ ) |
  405. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  406. | |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>`\ ) |
  407. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  408. | |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>`\ ) |
  409. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  410. | |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>`\ ) |
  411. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  412. | |void| | :ref:`set_overtype_mode_enabled<class_TextEdit_method_set_overtype_mode_enabled>`\ (\ enabled\: :ref:`bool<class_bool>`\ ) |
  413. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  414. | |void| | :ref:`set_search_flags<class_TextEdit_method_set_search_flags>`\ (\ flags\: :ref:`int<class_int>`\ ) |
  415. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  416. | |void| | :ref:`set_search_text<class_TextEdit_method_set_search_text>`\ (\ search_text\: :ref:`String<class_String>`\ ) |
  417. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  418. | |void| | :ref:`set_selection_mode<class_TextEdit_method_set_selection_mode>`\ (\ mode\: :ref:`SelectionMode<enum_TextEdit_SelectionMode>`\ ) |
  419. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  420. | |void| | :ref:`set_selection_origin_column<class_TextEdit_method_set_selection_origin_column>`\ (\ column\: :ref:`int<class_int>`, caret_index\: :ref:`int<class_int>` = 0\ ) |
  421. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  422. | |void| | :ref:`set_selection_origin_line<class_TextEdit_method_set_selection_origin_line>`\ (\ line\: :ref:`int<class_int>`, can_be_hidden\: :ref:`bool<class_bool>` = true, wrap_index\: :ref:`int<class_int>` = -1, caret_index\: :ref:`int<class_int>` = 0\ ) |
  423. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  424. | |void| | :ref:`set_tab_size<class_TextEdit_method_set_tab_size>`\ (\ size\: :ref:`int<class_int>`\ ) |
  425. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  426. | |void| | :ref:`set_tooltip_request_func<class_TextEdit_method_set_tooltip_request_func>`\ (\ callback\: :ref:`Callable<class_Callable>`\ ) |
  427. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  428. | |void| | :ref:`skip_selection_for_next_occurrence<class_TextEdit_method_skip_selection_for_next_occurrence>`\ (\ ) |
  429. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  430. | |void| | :ref:`start_action<class_TextEdit_method_start_action>`\ (\ action\: :ref:`EditAction<enum_TextEdit_EditAction>`\ ) |
  431. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  432. | |void| | :ref:`swap_lines<class_TextEdit_method_swap_lines>`\ (\ from_line\: :ref:`int<class_int>`, to_line\: :ref:`int<class_int>`\ ) |
  433. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  434. | |void| | :ref:`tag_saved_version<class_TextEdit_method_tag_saved_version>`\ (\ ) |
  435. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  436. | |void| | :ref:`undo<class_TextEdit_method_undo>`\ (\ ) |
  437. +--------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  438. .. rst-class:: classref-reftable-group
  439. Theme Properties
  440. ----------------
  441. .. table::
  442. :widths: auto
  443. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  444. | :ref:`Color<class_Color>` | :ref:`background_color<class_TextEdit_theme_color_background_color>` | ``Color(0, 0, 0, 0)`` |
  445. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  446. | :ref:`Color<class_Color>` | :ref:`caret_background_color<class_TextEdit_theme_color_caret_background_color>` | ``Color(0, 0, 0, 1)`` |
  447. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  448. | :ref:`Color<class_Color>` | :ref:`caret_color<class_TextEdit_theme_color_caret_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  449. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  450. | :ref:`Color<class_Color>` | :ref:`current_line_color<class_TextEdit_theme_color_current_line_color>` | ``Color(0.25, 0.25, 0.26, 0.8)`` |
  451. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  452. | :ref:`Color<class_Color>` | :ref:`font_color<class_TextEdit_theme_color_font_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  453. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  454. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_TextEdit_theme_color_font_outline_color>` | ``Color(0, 0, 0, 1)`` |
  455. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  456. | :ref:`Color<class_Color>` | :ref:`font_placeholder_color<class_TextEdit_theme_color_font_placeholder_color>` | ``Color(0.875, 0.875, 0.875, 0.6)`` |
  457. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  458. | :ref:`Color<class_Color>` | :ref:`font_readonly_color<class_TextEdit_theme_color_font_readonly_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  459. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  460. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_TextEdit_theme_color_font_selected_color>` | ``Color(0, 0, 0, 0)`` |
  461. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  462. | :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)`` |
  463. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  464. | :ref:`Color<class_Color>` | :ref:`search_result_color<class_TextEdit_theme_color_search_result_color>` | ``Color(0.3, 0.3, 0.3, 1)`` |
  465. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  466. | :ref:`Color<class_Color>` | :ref:`selection_color<class_TextEdit_theme_color_selection_color>` | ``Color(0.5, 0.5, 0.5, 1)`` |
  467. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  468. | :ref:`Color<class_Color>` | :ref:`word_highlighted_color<class_TextEdit_theme_color_word_highlighted_color>` | ``Color(0.5, 0.5, 0.5, 0.25)`` |
  469. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  470. | :ref:`int<class_int>` | :ref:`caret_width<class_TextEdit_theme_constant_caret_width>` | ``1`` |
  471. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  472. | :ref:`int<class_int>` | :ref:`line_spacing<class_TextEdit_theme_constant_line_spacing>` | ``4`` |
  473. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  474. | :ref:`int<class_int>` | :ref:`outline_size<class_TextEdit_theme_constant_outline_size>` | ``0`` |
  475. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  476. | :ref:`Font<class_Font>` | :ref:`font<class_TextEdit_theme_font_font>` | |
  477. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  478. | :ref:`int<class_int>` | :ref:`font_size<class_TextEdit_theme_font_size_font_size>` | |
  479. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  480. | :ref:`Texture2D<class_Texture2D>` | :ref:`space<class_TextEdit_theme_icon_space>` | |
  481. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  482. | :ref:`Texture2D<class_Texture2D>` | :ref:`tab<class_TextEdit_theme_icon_tab>` | |
  483. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  484. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_TextEdit_theme_style_focus>` | |
  485. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  486. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_TextEdit_theme_style_normal>` | |
  487. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  488. | :ref:`StyleBox<class_StyleBox>` | :ref:`read_only<class_TextEdit_theme_style_read_only>` | |
  489. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  490. .. rst-class:: classref-section-separator
  491. ----
  492. .. rst-class:: classref-descriptions-group
  493. Signals
  494. -------
  495. .. _class_TextEdit_signal_caret_changed:
  496. .. rst-class:: classref-signal
  497. **caret_changed**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_signal_caret_changed>`
  498. Emitted when any caret changes position.
  499. .. rst-class:: classref-item-separator
  500. ----
  501. .. _class_TextEdit_signal_gutter_added:
  502. .. rst-class:: classref-signal
  503. **gutter_added**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_signal_gutter_added>`
  504. Emitted when a gutter is added.
  505. .. rst-class:: classref-item-separator
  506. ----
  507. .. _class_TextEdit_signal_gutter_clicked:
  508. .. rst-class:: classref-signal
  509. **gutter_clicked**\ (\ line\: :ref:`int<class_int>`, gutter\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TextEdit_signal_gutter_clicked>`
  510. Emitted when a gutter is clicked.
  511. .. rst-class:: classref-item-separator
  512. ----
  513. .. _class_TextEdit_signal_gutter_removed:
  514. .. rst-class:: classref-signal
  515. **gutter_removed**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_signal_gutter_removed>`
  516. Emitted when a gutter is removed.
  517. .. rst-class:: classref-item-separator
  518. ----
  519. .. _class_TextEdit_signal_lines_edited_from:
  520. .. rst-class:: classref-signal
  521. **lines_edited_from**\ (\ from_line\: :ref:`int<class_int>`, to_line\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TextEdit_signal_lines_edited_from>`
  522. Emitted immediately when the text changes.
  523. When text is added ``from_line`` will be less than ``to_line``. On a remove ``to_line`` will be less than ``from_line``.
  524. .. rst-class:: classref-item-separator
  525. ----
  526. .. _class_TextEdit_signal_text_changed:
  527. .. rst-class:: classref-signal
  528. **text_changed**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_signal_text_changed>`
  529. Emitted when the text changes.
  530. .. rst-class:: classref-item-separator
  531. ----
  532. .. _class_TextEdit_signal_text_set:
  533. .. rst-class:: classref-signal
  534. **text_set**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_signal_text_set>`
  535. Emitted when :ref:`clear<class_TextEdit_method_clear>` is called or :ref:`text<class_TextEdit_property_text>` is set.
  536. .. rst-class:: classref-section-separator
  537. ----
  538. .. rst-class:: classref-descriptions-group
  539. Enumerations
  540. ------------
  541. .. _enum_TextEdit_MenuItems:
  542. .. rst-class:: classref-enumeration
  543. enum **MenuItems**: :ref:`๐Ÿ”—<enum_TextEdit_MenuItems>`
  544. .. _class_TextEdit_constant_MENU_CUT:
  545. .. rst-class:: classref-enumeration-constant
  546. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_CUT** = ``0``
  547. Cuts (copies and clears) the selected text.
  548. .. _class_TextEdit_constant_MENU_COPY:
  549. .. rst-class:: classref-enumeration-constant
  550. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_COPY** = ``1``
  551. Copies the selected text.
  552. .. _class_TextEdit_constant_MENU_PASTE:
  553. .. rst-class:: classref-enumeration-constant
  554. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_PASTE** = ``2``
  555. Pastes the clipboard text over the selected text (or at the cursor's position).
  556. .. _class_TextEdit_constant_MENU_CLEAR:
  557. .. rst-class:: classref-enumeration-constant
  558. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_CLEAR** = ``3``
  559. Erases the whole **TextEdit** text.
  560. .. _class_TextEdit_constant_MENU_SELECT_ALL:
  561. .. rst-class:: classref-enumeration-constant
  562. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_SELECT_ALL** = ``4``
  563. Selects the whole **TextEdit** text.
  564. .. _class_TextEdit_constant_MENU_UNDO:
  565. .. rst-class:: classref-enumeration-constant
  566. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_UNDO** = ``5``
  567. Undoes the previous action.
  568. .. _class_TextEdit_constant_MENU_REDO:
  569. .. rst-class:: classref-enumeration-constant
  570. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_REDO** = ``6``
  571. Redoes the previous action.
  572. .. _class_TextEdit_constant_MENU_SUBMENU_TEXT_DIR:
  573. .. rst-class:: classref-enumeration-constant
  574. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_SUBMENU_TEXT_DIR** = ``7``
  575. ID of "Text Writing Direction" submenu.
  576. .. _class_TextEdit_constant_MENU_DIR_INHERITED:
  577. .. rst-class:: classref-enumeration-constant
  578. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_DIR_INHERITED** = ``8``
  579. Sets text direction to inherited.
  580. .. _class_TextEdit_constant_MENU_DIR_AUTO:
  581. .. rst-class:: classref-enumeration-constant
  582. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_DIR_AUTO** = ``9``
  583. Sets text direction to automatic.
  584. .. _class_TextEdit_constant_MENU_DIR_LTR:
  585. .. rst-class:: classref-enumeration-constant
  586. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_DIR_LTR** = ``10``
  587. Sets text direction to left-to-right.
  588. .. _class_TextEdit_constant_MENU_DIR_RTL:
  589. .. rst-class:: classref-enumeration-constant
  590. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_DIR_RTL** = ``11``
  591. Sets text direction to right-to-left.
  592. .. _class_TextEdit_constant_MENU_DISPLAY_UCC:
  593. .. rst-class:: classref-enumeration-constant
  594. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_DISPLAY_UCC** = ``12``
  595. Toggles control character display.
  596. .. _class_TextEdit_constant_MENU_SUBMENU_INSERT_UCC:
  597. .. rst-class:: classref-enumeration-constant
  598. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_SUBMENU_INSERT_UCC** = ``13``
  599. ID of "Insert Control Character" submenu.
  600. .. _class_TextEdit_constant_MENU_INSERT_LRM:
  601. .. rst-class:: classref-enumeration-constant
  602. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_LRM** = ``14``
  603. Inserts left-to-right mark (LRM) character.
  604. .. _class_TextEdit_constant_MENU_INSERT_RLM:
  605. .. rst-class:: classref-enumeration-constant
  606. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_RLM** = ``15``
  607. Inserts right-to-left mark (RLM) character.
  608. .. _class_TextEdit_constant_MENU_INSERT_LRE:
  609. .. rst-class:: classref-enumeration-constant
  610. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_LRE** = ``16``
  611. Inserts start of left-to-right embedding (LRE) character.
  612. .. _class_TextEdit_constant_MENU_INSERT_RLE:
  613. .. rst-class:: classref-enumeration-constant
  614. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_RLE** = ``17``
  615. Inserts start of right-to-left embedding (RLE) character.
  616. .. _class_TextEdit_constant_MENU_INSERT_LRO:
  617. .. rst-class:: classref-enumeration-constant
  618. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_LRO** = ``18``
  619. Inserts start of left-to-right override (LRO) character.
  620. .. _class_TextEdit_constant_MENU_INSERT_RLO:
  621. .. rst-class:: classref-enumeration-constant
  622. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_RLO** = ``19``
  623. Inserts start of right-to-left override (RLO) character.
  624. .. _class_TextEdit_constant_MENU_INSERT_PDF:
  625. .. rst-class:: classref-enumeration-constant
  626. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_PDF** = ``20``
  627. Inserts pop direction formatting (PDF) character.
  628. .. _class_TextEdit_constant_MENU_INSERT_ALM:
  629. .. rst-class:: classref-enumeration-constant
  630. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_ALM** = ``21``
  631. Inserts Arabic letter mark (ALM) character.
  632. .. _class_TextEdit_constant_MENU_INSERT_LRI:
  633. .. rst-class:: classref-enumeration-constant
  634. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_LRI** = ``22``
  635. Inserts left-to-right isolate (LRI) character.
  636. .. _class_TextEdit_constant_MENU_INSERT_RLI:
  637. .. rst-class:: classref-enumeration-constant
  638. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_RLI** = ``23``
  639. Inserts right-to-left isolate (RLI) character.
  640. .. _class_TextEdit_constant_MENU_INSERT_FSI:
  641. .. rst-class:: classref-enumeration-constant
  642. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_FSI** = ``24``
  643. Inserts first strong isolate (FSI) character.
  644. .. _class_TextEdit_constant_MENU_INSERT_PDI:
  645. .. rst-class:: classref-enumeration-constant
  646. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_PDI** = ``25``
  647. Inserts pop direction isolate (PDI) character.
  648. .. _class_TextEdit_constant_MENU_INSERT_ZWJ:
  649. .. rst-class:: classref-enumeration-constant
  650. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_ZWJ** = ``26``
  651. Inserts zero width joiner (ZWJ) character.
  652. .. _class_TextEdit_constant_MENU_INSERT_ZWNJ:
  653. .. rst-class:: classref-enumeration-constant
  654. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_ZWNJ** = ``27``
  655. Inserts zero width non-joiner (ZWNJ) character.
  656. .. _class_TextEdit_constant_MENU_INSERT_WJ:
  657. .. rst-class:: classref-enumeration-constant
  658. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_WJ** = ``28``
  659. Inserts word joiner (WJ) character.
  660. .. _class_TextEdit_constant_MENU_INSERT_SHY:
  661. .. rst-class:: classref-enumeration-constant
  662. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_INSERT_SHY** = ``29``
  663. Inserts soft hyphen (SHY) character.
  664. .. _class_TextEdit_constant_MENU_MAX:
  665. .. rst-class:: classref-enumeration-constant
  666. :ref:`MenuItems<enum_TextEdit_MenuItems>` **MENU_MAX** = ``30``
  667. Represents the size of the :ref:`MenuItems<enum_TextEdit_MenuItems>` enum.
  668. .. rst-class:: classref-item-separator
  669. ----
  670. .. _enum_TextEdit_EditAction:
  671. .. rst-class:: classref-enumeration
  672. enum **EditAction**: :ref:`๐Ÿ”—<enum_TextEdit_EditAction>`
  673. .. _class_TextEdit_constant_ACTION_NONE:
  674. .. rst-class:: classref-enumeration-constant
  675. :ref:`EditAction<enum_TextEdit_EditAction>` **ACTION_NONE** = ``0``
  676. No current action.
  677. .. _class_TextEdit_constant_ACTION_TYPING:
  678. .. rst-class:: classref-enumeration-constant
  679. :ref:`EditAction<enum_TextEdit_EditAction>` **ACTION_TYPING** = ``1``
  680. A typing action.
  681. .. _class_TextEdit_constant_ACTION_BACKSPACE:
  682. .. rst-class:: classref-enumeration-constant
  683. :ref:`EditAction<enum_TextEdit_EditAction>` **ACTION_BACKSPACE** = ``2``
  684. A backwards delete action.
  685. .. _class_TextEdit_constant_ACTION_DELETE:
  686. .. rst-class:: classref-enumeration-constant
  687. :ref:`EditAction<enum_TextEdit_EditAction>` **ACTION_DELETE** = ``3``
  688. A forward delete action.
  689. .. rst-class:: classref-item-separator
  690. ----
  691. .. _enum_TextEdit_SearchFlags:
  692. .. rst-class:: classref-enumeration
  693. enum **SearchFlags**: :ref:`๐Ÿ”—<enum_TextEdit_SearchFlags>`
  694. .. _class_TextEdit_constant_SEARCH_MATCH_CASE:
  695. .. rst-class:: classref-enumeration-constant
  696. :ref:`SearchFlags<enum_TextEdit_SearchFlags>` **SEARCH_MATCH_CASE** = ``1``
  697. Match case when searching.
  698. .. _class_TextEdit_constant_SEARCH_WHOLE_WORDS:
  699. .. rst-class:: classref-enumeration-constant
  700. :ref:`SearchFlags<enum_TextEdit_SearchFlags>` **SEARCH_WHOLE_WORDS** = ``2``
  701. Match whole words when searching.
  702. .. _class_TextEdit_constant_SEARCH_BACKWARDS:
  703. .. rst-class:: classref-enumeration-constant
  704. :ref:`SearchFlags<enum_TextEdit_SearchFlags>` **SEARCH_BACKWARDS** = ``4``
  705. Search from end to beginning.
  706. .. rst-class:: classref-item-separator
  707. ----
  708. .. _enum_TextEdit_CaretType:
  709. .. rst-class:: classref-enumeration
  710. enum **CaretType**: :ref:`๐Ÿ”—<enum_TextEdit_CaretType>`
  711. .. _class_TextEdit_constant_CARET_TYPE_LINE:
  712. .. rst-class:: classref-enumeration-constant
  713. :ref:`CaretType<enum_TextEdit_CaretType>` **CARET_TYPE_LINE** = ``0``
  714. Vertical line caret.
  715. .. _class_TextEdit_constant_CARET_TYPE_BLOCK:
  716. .. rst-class:: classref-enumeration-constant
  717. :ref:`CaretType<enum_TextEdit_CaretType>` **CARET_TYPE_BLOCK** = ``1``
  718. Block caret.
  719. .. rst-class:: classref-item-separator
  720. ----
  721. .. _enum_TextEdit_SelectionMode:
  722. .. rst-class:: classref-enumeration
  723. enum **SelectionMode**: :ref:`๐Ÿ”—<enum_TextEdit_SelectionMode>`
  724. .. _class_TextEdit_constant_SELECTION_MODE_NONE:
  725. .. rst-class:: classref-enumeration-constant
  726. :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **SELECTION_MODE_NONE** = ``0``
  727. Not selecting.
  728. .. _class_TextEdit_constant_SELECTION_MODE_SHIFT:
  729. .. rst-class:: classref-enumeration-constant
  730. :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **SELECTION_MODE_SHIFT** = ``1``
  731. Select as if ``shift`` is pressed.
  732. .. _class_TextEdit_constant_SELECTION_MODE_POINTER:
  733. .. rst-class:: classref-enumeration-constant
  734. :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **SELECTION_MODE_POINTER** = ``2``
  735. Select single characters as if the user single clicked.
  736. .. _class_TextEdit_constant_SELECTION_MODE_WORD:
  737. .. rst-class:: classref-enumeration-constant
  738. :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **SELECTION_MODE_WORD** = ``3``
  739. Select whole words as if the user double clicked.
  740. .. _class_TextEdit_constant_SELECTION_MODE_LINE:
  741. .. rst-class:: classref-enumeration-constant
  742. :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **SELECTION_MODE_LINE** = ``4``
  743. Select whole lines as if the user triple clicked.
  744. .. rst-class:: classref-item-separator
  745. ----
  746. .. _enum_TextEdit_LineWrappingMode:
  747. .. rst-class:: classref-enumeration
  748. enum **LineWrappingMode**: :ref:`๐Ÿ”—<enum_TextEdit_LineWrappingMode>`
  749. .. _class_TextEdit_constant_LINE_WRAPPING_NONE:
  750. .. rst-class:: classref-enumeration-constant
  751. :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` **LINE_WRAPPING_NONE** = ``0``
  752. Line wrapping is disabled.
  753. .. _class_TextEdit_constant_LINE_WRAPPING_BOUNDARY:
  754. .. rst-class:: classref-enumeration-constant
  755. :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` **LINE_WRAPPING_BOUNDARY** = ``1``
  756. Line wrapping occurs at the control boundary, beyond what would normally be visible.
  757. .. rst-class:: classref-item-separator
  758. ----
  759. .. _enum_TextEdit_GutterType:
  760. .. rst-class:: classref-enumeration
  761. enum **GutterType**: :ref:`๐Ÿ”—<enum_TextEdit_GutterType>`
  762. .. _class_TextEdit_constant_GUTTER_TYPE_STRING:
  763. .. rst-class:: classref-enumeration-constant
  764. :ref:`GutterType<enum_TextEdit_GutterType>` **GUTTER_TYPE_STRING** = ``0``
  765. 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.
  766. .. _class_TextEdit_constant_GUTTER_TYPE_ICON:
  767. .. rst-class:: classref-enumeration-constant
  768. :ref:`GutterType<enum_TextEdit_GutterType>` **GUTTER_TYPE_ICON** = ``1``
  769. 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.
  770. .. _class_TextEdit_constant_GUTTER_TYPE_CUSTOM:
  771. .. rst-class:: classref-enumeration-constant
  772. :ref:`GutterType<enum_TextEdit_GutterType>` **GUTTER_TYPE_CUSTOM** = ``2``
  773. 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.
  774. .. rst-class:: classref-section-separator
  775. ----
  776. .. rst-class:: classref-descriptions-group
  777. Property Descriptions
  778. ---------------------
  779. .. _class_TextEdit_property_autowrap_mode:
  780. .. rst-class:: classref-property
  781. :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **autowrap_mode** = ``3`` :ref:`๐Ÿ”—<class_TextEdit_property_autowrap_mode>`
  782. .. rst-class:: classref-property-setget
  783. - |void| **set_autowrap_mode**\ (\ value\: :ref:`AutowrapMode<enum_TextServer_AutowrapMode>`\ )
  784. - :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **get_autowrap_mode**\ (\ )
  785. 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>`.
  786. .. rst-class:: classref-item-separator
  787. ----
  788. .. _class_TextEdit_property_caret_blink:
  789. .. rst-class:: classref-property
  790. :ref:`bool<class_bool>` **caret_blink** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_caret_blink>`
  791. .. rst-class:: classref-property-setget
  792. - |void| **set_caret_blink_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  793. - :ref:`bool<class_bool>` **is_caret_blink_enabled**\ (\ )
  794. If ``true``, makes the caret blink.
  795. .. rst-class:: classref-item-separator
  796. ----
  797. .. _class_TextEdit_property_caret_blink_interval:
  798. .. rst-class:: classref-property
  799. :ref:`float<class_float>` **caret_blink_interval** = ``0.65`` :ref:`๐Ÿ”—<class_TextEdit_property_caret_blink_interval>`
  800. .. rst-class:: classref-property-setget
  801. - |void| **set_caret_blink_interval**\ (\ value\: :ref:`float<class_float>`\ )
  802. - :ref:`float<class_float>` **get_caret_blink_interval**\ (\ )
  803. The interval at which the caret blinks (in seconds).
  804. .. rst-class:: classref-item-separator
  805. ----
  806. .. _class_TextEdit_property_caret_draw_when_editable_disabled:
  807. .. rst-class:: classref-property
  808. :ref:`bool<class_bool>` **caret_draw_when_editable_disabled** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_caret_draw_when_editable_disabled>`
  809. .. rst-class:: classref-property-setget
  810. - |void| **set_draw_caret_when_editable_disabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  811. - :ref:`bool<class_bool>` **is_drawing_caret_when_editable_disabled**\ (\ )
  812. If ``true``, caret will be visible when :ref:`editable<class_TextEdit_property_editable>` is disabled.
  813. .. rst-class:: classref-item-separator
  814. ----
  815. .. _class_TextEdit_property_caret_mid_grapheme:
  816. .. rst-class:: classref-property
  817. :ref:`bool<class_bool>` **caret_mid_grapheme** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_caret_mid_grapheme>`
  818. .. rst-class:: classref-property-setget
  819. - |void| **set_caret_mid_grapheme_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  820. - :ref:`bool<class_bool>` **is_caret_mid_grapheme_enabled**\ (\ )
  821. Allow moving caret, selecting and removing the individual composite character components.
  822. \ **Note:** :kbd:`Backspace` is always removing individual composite character components.
  823. .. rst-class:: classref-item-separator
  824. ----
  825. .. _class_TextEdit_property_caret_move_on_right_click:
  826. .. rst-class:: classref-property
  827. :ref:`bool<class_bool>` **caret_move_on_right_click** = ``true`` :ref:`๐Ÿ”—<class_TextEdit_property_caret_move_on_right_click>`
  828. .. rst-class:: classref-property-setget
  829. - |void| **set_move_caret_on_right_click_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  830. - :ref:`bool<class_bool>` **is_move_caret_on_right_click_enabled**\ (\ )
  831. If ``true``, a right-click moves the caret at the mouse position before displaying the context menu.
  832. If ``false``, the context menu ignores mouse location.
  833. .. rst-class:: classref-item-separator
  834. ----
  835. .. _class_TextEdit_property_caret_multiple:
  836. .. rst-class:: classref-property
  837. :ref:`bool<class_bool>` **caret_multiple** = ``true`` :ref:`๐Ÿ”—<class_TextEdit_property_caret_multiple>`
  838. .. rst-class:: classref-property-setget
  839. - |void| **set_multiple_carets_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  840. - :ref:`bool<class_bool>` **is_multiple_carets_enabled**\ (\ )
  841. Sets if multiple carets are allowed.
  842. .. rst-class:: classref-item-separator
  843. ----
  844. .. _class_TextEdit_property_caret_type:
  845. .. rst-class:: classref-property
  846. :ref:`CaretType<enum_TextEdit_CaretType>` **caret_type** = ``0`` :ref:`๐Ÿ”—<class_TextEdit_property_caret_type>`
  847. .. rst-class:: classref-property-setget
  848. - |void| **set_caret_type**\ (\ value\: :ref:`CaretType<enum_TextEdit_CaretType>`\ )
  849. - :ref:`CaretType<enum_TextEdit_CaretType>` **get_caret_type**\ (\ )
  850. Set the type of caret to draw.
  851. .. rst-class:: classref-item-separator
  852. ----
  853. .. _class_TextEdit_property_context_menu_enabled:
  854. .. rst-class:: classref-property
  855. :ref:`bool<class_bool>` **context_menu_enabled** = ``true`` :ref:`๐Ÿ”—<class_TextEdit_property_context_menu_enabled>`
  856. .. rst-class:: classref-property-setget
  857. - |void| **set_context_menu_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  858. - :ref:`bool<class_bool>` **is_context_menu_enabled**\ (\ )
  859. If ``true``, a right-click displays the context menu.
  860. .. rst-class:: classref-item-separator
  861. ----
  862. .. _class_TextEdit_property_custom_word_separators:
  863. .. rst-class:: classref-property
  864. :ref:`String<class_String>` **custom_word_separators** = ``""`` :ref:`๐Ÿ”—<class_TextEdit_property_custom_word_separators>`
  865. .. rst-class:: classref-property-setget
  866. - |void| **set_custom_word_separators**\ (\ value\: :ref:`String<class_String>`\ )
  867. - :ref:`String<class_String>` **get_custom_word_separators**\ (\ )
  868. The characters to consider as word delimiters if :ref:`use_custom_word_separators<class_TextEdit_property_use_custom_word_separators>` is ``true``. The characters should be defined without separation, for example ``#_!``.
  869. .. rst-class:: classref-item-separator
  870. ----
  871. .. _class_TextEdit_property_deselect_on_focus_loss_enabled:
  872. .. rst-class:: classref-property
  873. :ref:`bool<class_bool>` **deselect_on_focus_loss_enabled** = ``true`` :ref:`๐Ÿ”—<class_TextEdit_property_deselect_on_focus_loss_enabled>`
  874. .. rst-class:: classref-property-setget
  875. - |void| **set_deselect_on_focus_loss_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  876. - :ref:`bool<class_bool>` **is_deselect_on_focus_loss_enabled**\ (\ )
  877. If ``true``, the selected text will be deselected when focus is lost.
  878. .. rst-class:: classref-item-separator
  879. ----
  880. .. _class_TextEdit_property_drag_and_drop_selection_enabled:
  881. .. rst-class:: classref-property
  882. :ref:`bool<class_bool>` **drag_and_drop_selection_enabled** = ``true`` :ref:`๐Ÿ”—<class_TextEdit_property_drag_and_drop_selection_enabled>`
  883. .. rst-class:: classref-property-setget
  884. - |void| **set_drag_and_drop_selection_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  885. - :ref:`bool<class_bool>` **is_drag_and_drop_selection_enabled**\ (\ )
  886. If ``true``, allow drag and drop of selected text. Text can still be dropped from other sources.
  887. .. rst-class:: classref-item-separator
  888. ----
  889. .. _class_TextEdit_property_draw_control_chars:
  890. .. rst-class:: classref-property
  891. :ref:`bool<class_bool>` **draw_control_chars** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_draw_control_chars>`
  892. .. rst-class:: classref-property-setget
  893. - |void| **set_draw_control_chars**\ (\ value\: :ref:`bool<class_bool>`\ )
  894. - :ref:`bool<class_bool>` **get_draw_control_chars**\ (\ )
  895. If ``true``, control characters are displayed.
  896. .. rst-class:: classref-item-separator
  897. ----
  898. .. _class_TextEdit_property_draw_spaces:
  899. .. rst-class:: classref-property
  900. :ref:`bool<class_bool>` **draw_spaces** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_draw_spaces>`
  901. .. rst-class:: classref-property-setget
  902. - |void| **set_draw_spaces**\ (\ value\: :ref:`bool<class_bool>`\ )
  903. - :ref:`bool<class_bool>` **is_drawing_spaces**\ (\ )
  904. If ``true``, the "space" character will have a visible representation.
  905. .. rst-class:: classref-item-separator
  906. ----
  907. .. _class_TextEdit_property_draw_tabs:
  908. .. rst-class:: classref-property
  909. :ref:`bool<class_bool>` **draw_tabs** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_draw_tabs>`
  910. .. rst-class:: classref-property-setget
  911. - |void| **set_draw_tabs**\ (\ value\: :ref:`bool<class_bool>`\ )
  912. - :ref:`bool<class_bool>` **is_drawing_tabs**\ (\ )
  913. If ``true``, the "tab" character will have a visible representation.
  914. .. rst-class:: classref-item-separator
  915. ----
  916. .. _class_TextEdit_property_editable:
  917. .. rst-class:: classref-property
  918. :ref:`bool<class_bool>` **editable** = ``true`` :ref:`๐Ÿ”—<class_TextEdit_property_editable>`
  919. .. rst-class:: classref-property-setget
  920. - |void| **set_editable**\ (\ value\: :ref:`bool<class_bool>`\ )
  921. - :ref:`bool<class_bool>` **is_editable**\ (\ )
  922. If ``false``, existing text cannot be modified and new text cannot be added.
  923. .. rst-class:: classref-item-separator
  924. ----
  925. .. _class_TextEdit_property_empty_selection_clipboard_enabled:
  926. .. rst-class:: classref-property
  927. :ref:`bool<class_bool>` **empty_selection_clipboard_enabled** = ``true`` :ref:`๐Ÿ”—<class_TextEdit_property_empty_selection_clipboard_enabled>`
  928. .. rst-class:: classref-property-setget
  929. - |void| **set_empty_selection_clipboard_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  930. - :ref:`bool<class_bool>` **is_empty_selection_clipboard_enabled**\ (\ )
  931. If ``true``, copying or cutting without a selection is performed on all lines with a caret. Otherwise, copy and cut require a selection.
  932. .. rst-class:: classref-item-separator
  933. ----
  934. .. _class_TextEdit_property_highlight_all_occurrences:
  935. .. rst-class:: classref-property
  936. :ref:`bool<class_bool>` **highlight_all_occurrences** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_highlight_all_occurrences>`
  937. .. rst-class:: classref-property-setget
  938. - |void| **set_highlight_all_occurrences**\ (\ value\: :ref:`bool<class_bool>`\ )
  939. - :ref:`bool<class_bool>` **is_highlight_all_occurrences_enabled**\ (\ )
  940. If ``true``, all occurrences of the selected text will be highlighted.
  941. .. rst-class:: classref-item-separator
  942. ----
  943. .. _class_TextEdit_property_highlight_current_line:
  944. .. rst-class:: classref-property
  945. :ref:`bool<class_bool>` **highlight_current_line** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_highlight_current_line>`
  946. .. rst-class:: classref-property-setget
  947. - |void| **set_highlight_current_line**\ (\ value\: :ref:`bool<class_bool>`\ )
  948. - :ref:`bool<class_bool>` **is_highlight_current_line_enabled**\ (\ )
  949. If ``true``, the line containing the cursor is highlighted.
  950. .. rst-class:: classref-item-separator
  951. ----
  952. .. _class_TextEdit_property_indent_wrapped_lines:
  953. .. rst-class:: classref-property
  954. :ref:`bool<class_bool>` **indent_wrapped_lines** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_indent_wrapped_lines>`
  955. .. rst-class:: classref-property-setget
  956. - |void| **set_indent_wrapped_lines**\ (\ value\: :ref:`bool<class_bool>`\ )
  957. - :ref:`bool<class_bool>` **is_indent_wrapped_lines**\ (\ )
  958. If ``true``, all wrapped lines are indented to the same amount as the unwrapped line.
  959. .. rst-class:: classref-item-separator
  960. ----
  961. .. _class_TextEdit_property_language:
  962. .. rst-class:: classref-property
  963. :ref:`String<class_String>` **language** = ``""`` :ref:`๐Ÿ”—<class_TextEdit_property_language>`
  964. .. rst-class:: classref-property-setget
  965. - |void| **set_language**\ (\ value\: :ref:`String<class_String>`\ )
  966. - :ref:`String<class_String>` **get_language**\ (\ )
  967. Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  968. .. rst-class:: classref-item-separator
  969. ----
  970. .. _class_TextEdit_property_middle_mouse_paste_enabled:
  971. .. rst-class:: classref-property
  972. :ref:`bool<class_bool>` **middle_mouse_paste_enabled** = ``true`` :ref:`๐Ÿ”—<class_TextEdit_property_middle_mouse_paste_enabled>`
  973. .. rst-class:: classref-property-setget
  974. - |void| **set_middle_mouse_paste_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  975. - :ref:`bool<class_bool>` **is_middle_mouse_paste_enabled**\ (\ )
  976. If ``false``, using middle mouse button to paste clipboard will be disabled.
  977. \ **Note:** This method is only implemented on Linux.
  978. .. rst-class:: classref-item-separator
  979. ----
  980. .. _class_TextEdit_property_minimap_draw:
  981. .. rst-class:: classref-property
  982. :ref:`bool<class_bool>` **minimap_draw** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_minimap_draw>`
  983. .. rst-class:: classref-property-setget
  984. - |void| **set_draw_minimap**\ (\ value\: :ref:`bool<class_bool>`\ )
  985. - :ref:`bool<class_bool>` **is_drawing_minimap**\ (\ )
  986. If ``true``, a minimap is shown, providing an outline of your source code. The minimap uses a fixed-width text size.
  987. .. rst-class:: classref-item-separator
  988. ----
  989. .. _class_TextEdit_property_minimap_width:
  990. .. rst-class:: classref-property
  991. :ref:`int<class_int>` **minimap_width** = ``80`` :ref:`๐Ÿ”—<class_TextEdit_property_minimap_width>`
  992. .. rst-class:: classref-property-setget
  993. - |void| **set_minimap_width**\ (\ value\: :ref:`int<class_int>`\ )
  994. - :ref:`int<class_int>` **get_minimap_width**\ (\ )
  995. The width, in pixels, of the minimap.
  996. .. rst-class:: classref-item-separator
  997. ----
  998. .. _class_TextEdit_property_placeholder_text:
  999. .. rst-class:: classref-property
  1000. :ref:`String<class_String>` **placeholder_text** = ``""`` :ref:`๐Ÿ”—<class_TextEdit_property_placeholder_text>`
  1001. .. rst-class:: classref-property-setget
  1002. - |void| **set_placeholder**\ (\ value\: :ref:`String<class_String>`\ )
  1003. - :ref:`String<class_String>` **get_placeholder**\ (\ )
  1004. Text shown when the **TextEdit** is empty. It is **not** the **TextEdit**'s default value (see :ref:`text<class_TextEdit_property_text>`).
  1005. .. rst-class:: classref-item-separator
  1006. ----
  1007. .. _class_TextEdit_property_scroll_fit_content_height:
  1008. .. rst-class:: classref-property
  1009. :ref:`bool<class_bool>` **scroll_fit_content_height** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_scroll_fit_content_height>`
  1010. .. rst-class:: classref-property-setget
  1011. - |void| **set_fit_content_height_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  1012. - :ref:`bool<class_bool>` **is_fit_content_height_enabled**\ (\ )
  1013. If ``true``, **TextEdit** will disable vertical scroll and fit minimum height to the number of visible lines. When both this property and :ref:`scroll_fit_content_width<class_TextEdit_property_scroll_fit_content_width>` are ``true``, no scrollbars will be displayed.
  1014. .. rst-class:: classref-item-separator
  1015. ----
  1016. .. _class_TextEdit_property_scroll_fit_content_width:
  1017. .. rst-class:: classref-property
  1018. :ref:`bool<class_bool>` **scroll_fit_content_width** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_scroll_fit_content_width>`
  1019. .. rst-class:: classref-property-setget
  1020. - |void| **set_fit_content_width_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  1021. - :ref:`bool<class_bool>` **is_fit_content_width_enabled**\ (\ )
  1022. If ``true``, **TextEdit** will disable horizontal scroll and fit minimum width to the widest line in the text. When both this property and :ref:`scroll_fit_content_height<class_TextEdit_property_scroll_fit_content_height>` are ``true``, no scrollbars will be displayed.
  1023. .. rst-class:: classref-item-separator
  1024. ----
  1025. .. _class_TextEdit_property_scroll_horizontal:
  1026. .. rst-class:: classref-property
  1027. :ref:`int<class_int>` **scroll_horizontal** = ``0`` :ref:`๐Ÿ”—<class_TextEdit_property_scroll_horizontal>`
  1028. .. rst-class:: classref-property-setget
  1029. - |void| **set_h_scroll**\ (\ value\: :ref:`int<class_int>`\ )
  1030. - :ref:`int<class_int>` **get_h_scroll**\ (\ )
  1031. If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels.
  1032. .. rst-class:: classref-item-separator
  1033. ----
  1034. .. _class_TextEdit_property_scroll_past_end_of_file:
  1035. .. rst-class:: classref-property
  1036. :ref:`bool<class_bool>` **scroll_past_end_of_file** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_scroll_past_end_of_file>`
  1037. .. rst-class:: classref-property-setget
  1038. - |void| **set_scroll_past_end_of_file_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  1039. - :ref:`bool<class_bool>` **is_scroll_past_end_of_file_enabled**\ (\ )
  1040. Allow scrolling past the last line into "virtual" space.
  1041. .. rst-class:: classref-item-separator
  1042. ----
  1043. .. _class_TextEdit_property_scroll_smooth:
  1044. .. rst-class:: classref-property
  1045. :ref:`bool<class_bool>` **scroll_smooth** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_scroll_smooth>`
  1046. .. rst-class:: classref-property-setget
  1047. - |void| **set_smooth_scroll_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  1048. - :ref:`bool<class_bool>` **is_smooth_scroll_enabled**\ (\ )
  1049. Scroll smoothly over the text rather than jumping to the next location.
  1050. .. rst-class:: classref-item-separator
  1051. ----
  1052. .. _class_TextEdit_property_scroll_v_scroll_speed:
  1053. .. rst-class:: classref-property
  1054. :ref:`float<class_float>` **scroll_v_scroll_speed** = ``80.0`` :ref:`๐Ÿ”—<class_TextEdit_property_scroll_v_scroll_speed>`
  1055. .. rst-class:: classref-property-setget
  1056. - |void| **set_v_scroll_speed**\ (\ value\: :ref:`float<class_float>`\ )
  1057. - :ref:`float<class_float>` **get_v_scroll_speed**\ (\ )
  1058. Sets the scroll speed with the minimap or when :ref:`scroll_smooth<class_TextEdit_property_scroll_smooth>` is enabled.
  1059. .. rst-class:: classref-item-separator
  1060. ----
  1061. .. _class_TextEdit_property_scroll_vertical:
  1062. .. rst-class:: classref-property
  1063. :ref:`float<class_float>` **scroll_vertical** = ``0.0`` :ref:`๐Ÿ”—<class_TextEdit_property_scroll_vertical>`
  1064. .. rst-class:: classref-property-setget
  1065. - |void| **set_v_scroll**\ (\ value\: :ref:`float<class_float>`\ )
  1066. - :ref:`float<class_float>` **get_v_scroll**\ (\ )
  1067. If there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line.
  1068. .. rst-class:: classref-item-separator
  1069. ----
  1070. .. _class_TextEdit_property_selecting_enabled:
  1071. .. rst-class:: classref-property
  1072. :ref:`bool<class_bool>` **selecting_enabled** = ``true`` :ref:`๐Ÿ”—<class_TextEdit_property_selecting_enabled>`
  1073. .. rst-class:: classref-property-setget
  1074. - |void| **set_selecting_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  1075. - :ref:`bool<class_bool>` **is_selecting_enabled**\ (\ )
  1076. If ``true``, text can be selected.
  1077. 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.
  1078. .. rst-class:: classref-item-separator
  1079. ----
  1080. .. _class_TextEdit_property_shortcut_keys_enabled:
  1081. .. rst-class:: classref-property
  1082. :ref:`bool<class_bool>` **shortcut_keys_enabled** = ``true`` :ref:`๐Ÿ”—<class_TextEdit_property_shortcut_keys_enabled>`
  1083. .. rst-class:: classref-property-setget
  1084. - |void| **set_shortcut_keys_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  1085. - :ref:`bool<class_bool>` **is_shortcut_keys_enabled**\ (\ )
  1086. If ``true``, shortcut keys for context menu items are enabled, even if the context menu is disabled.
  1087. .. rst-class:: classref-item-separator
  1088. ----
  1089. .. _class_TextEdit_property_structured_text_bidi_override:
  1090. .. rst-class:: classref-property
  1091. :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **structured_text_bidi_override** = ``0`` :ref:`๐Ÿ”—<class_TextEdit_property_structured_text_bidi_override>`
  1092. .. rst-class:: classref-property-setget
  1093. - |void| **set_structured_text_bidi_override**\ (\ value\: :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>`\ )
  1094. - :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **get_structured_text_bidi_override**\ (\ )
  1095. Set BiDi algorithm override for the structured text.
  1096. .. rst-class:: classref-item-separator
  1097. ----
  1098. .. _class_TextEdit_property_structured_text_bidi_override_options:
  1099. .. rst-class:: classref-property
  1100. :ref:`Array<class_Array>` **structured_text_bidi_override_options** = ``[]`` :ref:`๐Ÿ”—<class_TextEdit_property_structured_text_bidi_override_options>`
  1101. .. rst-class:: classref-property-setget
  1102. - |void| **set_structured_text_bidi_override_options**\ (\ value\: :ref:`Array<class_Array>`\ )
  1103. - :ref:`Array<class_Array>` **get_structured_text_bidi_override_options**\ (\ )
  1104. Set additional options for BiDi override.
  1105. .. rst-class:: classref-item-separator
  1106. ----
  1107. .. _class_TextEdit_property_syntax_highlighter:
  1108. .. rst-class:: classref-property
  1109. :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` **syntax_highlighter** :ref:`๐Ÿ”—<class_TextEdit_property_syntax_highlighter>`
  1110. .. rst-class:: classref-property-setget
  1111. - |void| **set_syntax_highlighter**\ (\ value\: :ref:`SyntaxHighlighter<class_SyntaxHighlighter>`\ )
  1112. - :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` **get_syntax_highlighter**\ (\ )
  1113. The syntax highlighter to use.
  1114. \ **Note:** A :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` instance should not be used across multiple **TextEdit** nodes.
  1115. .. rst-class:: classref-item-separator
  1116. ----
  1117. .. _class_TextEdit_property_text:
  1118. .. rst-class:: classref-property
  1119. :ref:`String<class_String>` **text** = ``""`` :ref:`๐Ÿ”—<class_TextEdit_property_text>`
  1120. .. rst-class:: classref-property-setget
  1121. - |void| **set_text**\ (\ value\: :ref:`String<class_String>`\ )
  1122. - :ref:`String<class_String>` **get_text**\ (\ )
  1123. String value of the **TextEdit**.
  1124. .. rst-class:: classref-item-separator
  1125. ----
  1126. .. _class_TextEdit_property_text_direction:
  1127. .. rst-class:: classref-property
  1128. :ref:`TextDirection<enum_Control_TextDirection>` **text_direction** = ``0`` :ref:`๐Ÿ”—<class_TextEdit_property_text_direction>`
  1129. .. rst-class:: classref-property-setget
  1130. - |void| **set_text_direction**\ (\ value\: :ref:`TextDirection<enum_Control_TextDirection>`\ )
  1131. - :ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction**\ (\ )
  1132. Base text writing direction.
  1133. .. rst-class:: classref-item-separator
  1134. ----
  1135. .. _class_TextEdit_property_use_custom_word_separators:
  1136. .. rst-class:: classref-property
  1137. :ref:`bool<class_bool>` **use_custom_word_separators** = ``false`` :ref:`๐Ÿ”—<class_TextEdit_property_use_custom_word_separators>`
  1138. .. rst-class:: classref-property-setget
  1139. - |void| **set_use_custom_word_separators**\ (\ value\: :ref:`bool<class_bool>`\ )
  1140. - :ref:`bool<class_bool>` **is_custom_word_separators_enabled**\ (\ )
  1141. If ``false``, using :kbd:`Ctrl + Left` or :kbd:`Ctrl + Right` (:kbd:`Cmd + Left` or :kbd:`Cmd + Right` on macOS) bindings will use the behavior of :ref:`use_default_word_separators<class_TextEdit_property_use_default_word_separators>`. If ``true``, it will also stop the caret if a character within :ref:`custom_word_separators<class_TextEdit_property_custom_word_separators>` is detected. Useful for subword moving. This behavior also will be applied to the behavior of text selection.
  1142. .. rst-class:: classref-item-separator
  1143. ----
  1144. .. _class_TextEdit_property_use_default_word_separators:
  1145. .. rst-class:: classref-property
  1146. :ref:`bool<class_bool>` **use_default_word_separators** = ``true`` :ref:`๐Ÿ”—<class_TextEdit_property_use_default_word_separators>`
  1147. .. rst-class:: classref-property-setget
  1148. - |void| **set_use_default_word_separators**\ (\ value\: :ref:`bool<class_bool>`\ )
  1149. - :ref:`bool<class_bool>` **is_default_word_separators_enabled**\ (\ )
  1150. If ``false``, using :kbd:`Ctrl + Left` or :kbd:`Ctrl + Right` (:kbd:`Cmd + Left` or :kbd:`Cmd + Right` on macOS) bindings will stop moving caret only if a space or punctuation is detected. If ``true``, it will also stop the caret if a character is part of ``!"#$%&'()*+,-./:;<=>?@[\]^`{|}~``, the Unicode General Punctuation table, or the Unicode CJK Punctuation table. Useful for subword moving. This behavior also will be applied to the behavior of text selection.
  1151. .. rst-class:: classref-item-separator
  1152. ----
  1153. .. _class_TextEdit_property_virtual_keyboard_enabled:
  1154. .. rst-class:: classref-property
  1155. :ref:`bool<class_bool>` **virtual_keyboard_enabled** = ``true`` :ref:`๐Ÿ”—<class_TextEdit_property_virtual_keyboard_enabled>`
  1156. .. rst-class:: classref-property-setget
  1157. - |void| **set_virtual_keyboard_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  1158. - :ref:`bool<class_bool>` **is_virtual_keyboard_enabled**\ (\ )
  1159. If ``true``, the native virtual keyboard is shown when focused on platforms that support it.
  1160. .. rst-class:: classref-item-separator
  1161. ----
  1162. .. _class_TextEdit_property_wrap_mode:
  1163. .. rst-class:: classref-property
  1164. :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` **wrap_mode** = ``0`` :ref:`๐Ÿ”—<class_TextEdit_property_wrap_mode>`
  1165. .. rst-class:: classref-property-setget
  1166. - |void| **set_line_wrapping_mode**\ (\ value\: :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>`\ )
  1167. - :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` **get_line_wrapping_mode**\ (\ )
  1168. Sets the line wrapping mode to use.
  1169. .. rst-class:: classref-section-separator
  1170. ----
  1171. .. rst-class:: classref-descriptions-group
  1172. Method Descriptions
  1173. -------------------
  1174. .. _class_TextEdit_private_method__backspace:
  1175. .. rst-class:: classref-method
  1176. |void| **_backspace**\ (\ caret_index\: :ref:`int<class_int>`\ ) |virtual| :ref:`๐Ÿ”—<class_TextEdit_private_method__backspace>`
  1177. Override this method to define what happens when the user presses the backspace key.
  1178. .. rst-class:: classref-item-separator
  1179. ----
  1180. .. _class_TextEdit_private_method__copy:
  1181. .. rst-class:: classref-method
  1182. |void| **_copy**\ (\ caret_index\: :ref:`int<class_int>`\ ) |virtual| :ref:`๐Ÿ”—<class_TextEdit_private_method__copy>`
  1183. Override this method to define what happens when the user performs a copy operation.
  1184. .. rst-class:: classref-item-separator
  1185. ----
  1186. .. _class_TextEdit_private_method__cut:
  1187. .. rst-class:: classref-method
  1188. |void| **_cut**\ (\ caret_index\: :ref:`int<class_int>`\ ) |virtual| :ref:`๐Ÿ”—<class_TextEdit_private_method__cut>`
  1189. Override this method to define what happens when the user performs a cut operation.
  1190. .. rst-class:: classref-item-separator
  1191. ----
  1192. .. _class_TextEdit_private_method__handle_unicode_input:
  1193. .. rst-class:: classref-method
  1194. |void| **_handle_unicode_input**\ (\ unicode_char\: :ref:`int<class_int>`, caret_index\: :ref:`int<class_int>`\ ) |virtual| :ref:`๐Ÿ”—<class_TextEdit_private_method__handle_unicode_input>`
  1195. Override this method to define what happens when the user types in the provided key ``unicode_char``.
  1196. .. rst-class:: classref-item-separator
  1197. ----
  1198. .. _class_TextEdit_private_method__paste:
  1199. .. rst-class:: classref-method
  1200. |void| **_paste**\ (\ caret_index\: :ref:`int<class_int>`\ ) |virtual| :ref:`๐Ÿ”—<class_TextEdit_private_method__paste>`
  1201. Override this method to define what happens when the user performs a paste operation.
  1202. .. rst-class:: classref-item-separator
  1203. ----
  1204. .. _class_TextEdit_private_method__paste_primary_clipboard:
  1205. .. rst-class:: classref-method
  1206. |void| **_paste_primary_clipboard**\ (\ caret_index\: :ref:`int<class_int>`\ ) |virtual| :ref:`๐Ÿ”—<class_TextEdit_private_method__paste_primary_clipboard>`
  1207. Override this method to define what happens when the user performs a paste operation with middle mouse button.
  1208. \ **Note:** This method is only implemented on Linux.
  1209. .. rst-class:: classref-item-separator
  1210. ----
  1211. .. _class_TextEdit_method_add_caret:
  1212. .. rst-class:: classref-method
  1213. :ref:`int<class_int>` **add_caret**\ (\ line\: :ref:`int<class_int>`, column\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_add_caret>`
  1214. Adds a new caret at the given location. Returns the index of the new caret, or ``-1`` if the location is invalid.
  1215. .. rst-class:: classref-item-separator
  1216. ----
  1217. .. _class_TextEdit_method_add_caret_at_carets:
  1218. .. rst-class:: classref-method
  1219. |void| **add_caret_at_carets**\ (\ below\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_add_caret_at_carets>`
  1220. Adds an additional caret above or below every caret. If ``below`` is ``true`` the new caret will be added below and above otherwise.
  1221. .. rst-class:: classref-item-separator
  1222. ----
  1223. .. _class_TextEdit_method_add_gutter:
  1224. .. rst-class:: classref-method
  1225. |void| **add_gutter**\ (\ at\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TextEdit_method_add_gutter>`
  1226. 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.
  1227. .. rst-class:: classref-item-separator
  1228. ----
  1229. .. _class_TextEdit_method_add_selection_for_next_occurrence:
  1230. .. rst-class:: classref-method
  1231. |void| **add_selection_for_next_occurrence**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_add_selection_for_next_occurrence>`
  1232. Adds a selection and a caret for the next occurrence of the current selection. If there is no active selection, selects word under caret.
  1233. .. rst-class:: classref-item-separator
  1234. ----
  1235. .. _class_TextEdit_method_adjust_carets_after_edit:
  1236. .. rst-class:: classref-method
  1237. |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>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_adjust_carets_after_edit>`
  1238. **Deprecated:** No longer necessary since methods now adjust carets themselves.
  1239. This method does nothing.
  1240. .. rst-class:: classref-item-separator
  1241. ----
  1242. .. _class_TextEdit_method_adjust_viewport_to_caret:
  1243. .. rst-class:: classref-method
  1244. |void| **adjust_viewport_to_caret**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) :ref:`๐Ÿ”—<class_TextEdit_method_adjust_viewport_to_caret>`
  1245. Adjust the viewport so the caret is visible.
  1246. .. rst-class:: classref-item-separator
  1247. ----
  1248. .. _class_TextEdit_method_apply_ime:
  1249. .. rst-class:: classref-method
  1250. |void| **apply_ime**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_apply_ime>`
  1251. 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.
  1252. .. rst-class:: classref-item-separator
  1253. ----
  1254. .. _class_TextEdit_method_backspace:
  1255. .. rst-class:: classref-method
  1256. |void| **backspace**\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TextEdit_method_backspace>`
  1257. Called when the user presses the backspace key. Can be overridden with :ref:`_backspace<class_TextEdit_private_method__backspace>`.
  1258. .. rst-class:: classref-item-separator
  1259. ----
  1260. .. _class_TextEdit_method_begin_complex_operation:
  1261. .. rst-class:: classref-method
  1262. |void| **begin_complex_operation**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_begin_complex_operation>`
  1263. 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.
  1264. .. rst-class:: classref-item-separator
  1265. ----
  1266. .. _class_TextEdit_method_begin_multicaret_edit:
  1267. .. rst-class:: classref-method
  1268. |void| **begin_multicaret_edit**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_begin_multicaret_edit>`
  1269. Starts an edit for multiple carets. The edit must be ended with :ref:`end_multicaret_edit<class_TextEdit_method_end_multicaret_edit>`. Multicaret edits can be used to edit text at multiple carets and delay merging the carets until the end, so the caret indexes aren't affected immediately. :ref:`begin_multicaret_edit<class_TextEdit_method_begin_multicaret_edit>` and :ref:`end_multicaret_edit<class_TextEdit_method_end_multicaret_edit>` can be nested, and the merge will happen at the last :ref:`end_multicaret_edit<class_TextEdit_method_end_multicaret_edit>`.
  1270. ::
  1271. begin_complex_operation()
  1272. begin_multicaret_edit()
  1273. for i in range(get_caret_count()):
  1274. if multicaret_edit_ignore_caret(i):
  1275. continue
  1276. # Logic here.
  1277. end_multicaret_edit()
  1278. end_complex_operation()
  1279. .. rst-class:: classref-item-separator
  1280. ----
  1281. .. _class_TextEdit_method_cancel_ime:
  1282. .. rst-class:: classref-method
  1283. |void| **cancel_ime**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_cancel_ime>`
  1284. 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.
  1285. .. rst-class:: classref-item-separator
  1286. ----
  1287. .. _class_TextEdit_method_center_viewport_to_caret:
  1288. .. rst-class:: classref-method
  1289. |void| **center_viewport_to_caret**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) :ref:`๐Ÿ”—<class_TextEdit_method_center_viewport_to_caret>`
  1290. 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``.
  1291. .. rst-class:: classref-item-separator
  1292. ----
  1293. .. _class_TextEdit_method_clear:
  1294. .. rst-class:: classref-method
  1295. |void| **clear**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_clear>`
  1296. Performs a full reset of **TextEdit**, including undo history.
  1297. .. rst-class:: classref-item-separator
  1298. ----
  1299. .. _class_TextEdit_method_clear_undo_history:
  1300. .. rst-class:: classref-method
  1301. |void| **clear_undo_history**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_clear_undo_history>`
  1302. Clears the undo history.
  1303. .. rst-class:: classref-item-separator
  1304. ----
  1305. .. _class_TextEdit_method_collapse_carets:
  1306. .. rst-class:: classref-method
  1307. |void| **collapse_carets**\ (\ from_line\: :ref:`int<class_int>`, from_column\: :ref:`int<class_int>`, to_line\: :ref:`int<class_int>`, to_column\: :ref:`int<class_int>`, inclusive\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_TextEdit_method_collapse_carets>`
  1308. Collapse all carets in the given range to the ``from_line`` and ``from_column`` position.
  1309. \ ``inclusive`` applies to both ends.
  1310. If :ref:`is_in_mulitcaret_edit<class_TextEdit_method_is_in_mulitcaret_edit>` is ``true``, carets that are collapsed will be ``true`` for :ref:`multicaret_edit_ignore_caret<class_TextEdit_method_multicaret_edit_ignore_caret>`.
  1311. \ :ref:`merge_overlapping_carets<class_TextEdit_method_merge_overlapping_carets>` will be called if any carets were collapsed.
  1312. .. rst-class:: classref-item-separator
  1313. ----
  1314. .. _class_TextEdit_method_copy:
  1315. .. rst-class:: classref-method
  1316. |void| **copy**\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TextEdit_method_copy>`
  1317. Copies the current text selection. Can be overridden with :ref:`_copy<class_TextEdit_private_method__copy>`.
  1318. .. rst-class:: classref-item-separator
  1319. ----
  1320. .. _class_TextEdit_method_cut:
  1321. .. rst-class:: classref-method
  1322. |void| **cut**\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TextEdit_method_cut>`
  1323. Cut's the current selection. Can be overridden with :ref:`_cut<class_TextEdit_private_method__cut>`.
  1324. .. rst-class:: classref-item-separator
  1325. ----
  1326. .. _class_TextEdit_method_delete_selection:
  1327. .. rst-class:: classref-method
  1328. |void| **delete_selection**\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TextEdit_method_delete_selection>`
  1329. Deletes the selected text.
  1330. .. rst-class:: classref-item-separator
  1331. ----
  1332. .. _class_TextEdit_method_deselect:
  1333. .. rst-class:: classref-method
  1334. |void| **deselect**\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TextEdit_method_deselect>`
  1335. Deselects the current selection.
  1336. .. rst-class:: classref-item-separator
  1337. ----
  1338. .. _class_TextEdit_method_end_action:
  1339. .. rst-class:: classref-method
  1340. |void| **end_action**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_end_action>`
  1341. Marks the end of steps in the current action started with :ref:`start_action<class_TextEdit_method_start_action>`.
  1342. .. rst-class:: classref-item-separator
  1343. ----
  1344. .. _class_TextEdit_method_end_complex_operation:
  1345. .. rst-class:: classref-method
  1346. |void| **end_complex_operation**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_end_complex_operation>`
  1347. 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.
  1348. .. rst-class:: classref-item-separator
  1349. ----
  1350. .. _class_TextEdit_method_end_multicaret_edit:
  1351. .. rst-class:: classref-method
  1352. |void| **end_multicaret_edit**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_end_multicaret_edit>`
  1353. Ends an edit for multiple carets, that was started with :ref:`begin_multicaret_edit<class_TextEdit_method_begin_multicaret_edit>`. If this was the last :ref:`end_multicaret_edit<class_TextEdit_method_end_multicaret_edit>` and :ref:`merge_overlapping_carets<class_TextEdit_method_merge_overlapping_carets>` was called, carets will be merged.
  1354. .. rst-class:: classref-item-separator
  1355. ----
  1356. .. _class_TextEdit_method_get_caret_column:
  1357. .. rst-class:: classref-method
  1358. :ref:`int<class_int>` **get_caret_column**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_caret_column>`
  1359. Returns the column the editing caret is at.
  1360. .. rst-class:: classref-item-separator
  1361. ----
  1362. .. _class_TextEdit_method_get_caret_count:
  1363. .. rst-class:: classref-method
  1364. :ref:`int<class_int>` **get_caret_count**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_caret_count>`
  1365. Returns the number of carets in this **TextEdit**.
  1366. .. rst-class:: classref-item-separator
  1367. ----
  1368. .. _class_TextEdit_method_get_caret_draw_pos:
  1369. .. rst-class:: classref-method
  1370. :ref:`Vector2<class_Vector2>` **get_caret_draw_pos**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_caret_draw_pos>`
  1371. Returns the caret pixel draw position.
  1372. .. rst-class:: classref-item-separator
  1373. ----
  1374. .. _class_TextEdit_method_get_caret_index_edit_order:
  1375. .. rst-class:: classref-method
  1376. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_caret_index_edit_order**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_get_caret_index_edit_order>`
  1377. **Deprecated:** Carets no longer need to be edited in any specific order. If the carets need to be sorted, use :ref:`get_sorted_carets<class_TextEdit_method_get_sorted_carets>` instead.
  1378. 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.
  1379. .. rst-class:: classref-item-separator
  1380. ----
  1381. .. _class_TextEdit_method_get_caret_line:
  1382. .. rst-class:: classref-method
  1383. :ref:`int<class_int>` **get_caret_line**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_caret_line>`
  1384. Returns the line the editing caret is on.
  1385. .. rst-class:: classref-item-separator
  1386. ----
  1387. .. _class_TextEdit_method_get_caret_wrap_index:
  1388. .. rst-class:: classref-method
  1389. :ref:`int<class_int>` **get_caret_wrap_index**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_caret_wrap_index>`
  1390. Returns the wrap index the editing caret is on.
  1391. .. rst-class:: classref-item-separator
  1392. ----
  1393. .. _class_TextEdit_method_get_first_non_whitespace_column:
  1394. .. rst-class:: classref-method
  1395. :ref:`int<class_int>` **get_first_non_whitespace_column**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_first_non_whitespace_column>`
  1396. Returns the first column containing a non-whitespace character.
  1397. .. rst-class:: classref-item-separator
  1398. ----
  1399. .. _class_TextEdit_method_get_first_visible_line:
  1400. .. rst-class:: classref-method
  1401. :ref:`int<class_int>` **get_first_visible_line**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_first_visible_line>`
  1402. Returns the first visible line.
  1403. .. rst-class:: classref-item-separator
  1404. ----
  1405. .. _class_TextEdit_method_get_gutter_count:
  1406. .. rst-class:: classref-method
  1407. :ref:`int<class_int>` **get_gutter_count**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_gutter_count>`
  1408. Returns the number of gutters registered.
  1409. .. rst-class:: classref-item-separator
  1410. ----
  1411. .. _class_TextEdit_method_get_gutter_name:
  1412. .. rst-class:: classref-method
  1413. :ref:`String<class_String>` **get_gutter_name**\ (\ gutter\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_gutter_name>`
  1414. Returns the name of the gutter at the given index.
  1415. .. rst-class:: classref-item-separator
  1416. ----
  1417. .. _class_TextEdit_method_get_gutter_type:
  1418. .. rst-class:: classref-method
  1419. :ref:`GutterType<enum_TextEdit_GutterType>` **get_gutter_type**\ (\ gutter\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_gutter_type>`
  1420. 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.
  1421. .. rst-class:: classref-item-separator
  1422. ----
  1423. .. _class_TextEdit_method_get_gutter_width:
  1424. .. rst-class:: classref-method
  1425. :ref:`int<class_int>` **get_gutter_width**\ (\ gutter\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_gutter_width>`
  1426. Returns the width of the gutter at the given index.
  1427. .. rst-class:: classref-item-separator
  1428. ----
  1429. .. _class_TextEdit_method_get_h_scroll_bar:
  1430. .. rst-class:: classref-method
  1431. :ref:`HScrollBar<class_HScrollBar>` **get_h_scroll_bar**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_h_scroll_bar>`
  1432. Returns the :ref:`HScrollBar<class_HScrollBar>` used by **TextEdit**.
  1433. .. rst-class:: classref-item-separator
  1434. ----
  1435. .. _class_TextEdit_method_get_indent_level:
  1436. .. rst-class:: classref-method
  1437. :ref:`int<class_int>` **get_indent_level**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_indent_level>`
  1438. Returns the number of spaces and ``tab * tab_size`` before the first char.
  1439. .. rst-class:: classref-item-separator
  1440. ----
  1441. .. _class_TextEdit_method_get_last_full_visible_line:
  1442. .. rst-class:: classref-method
  1443. :ref:`int<class_int>` **get_last_full_visible_line**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_last_full_visible_line>`
  1444. 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.
  1445. .. rst-class:: classref-item-separator
  1446. ----
  1447. .. _class_TextEdit_method_get_last_full_visible_line_wrap_index:
  1448. .. rst-class:: classref-method
  1449. :ref:`int<class_int>` **get_last_full_visible_line_wrap_index**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_last_full_visible_line_wrap_index>`
  1450. Returns the last visible wrap index of the last visible line.
  1451. .. rst-class:: classref-item-separator
  1452. ----
  1453. .. _class_TextEdit_method_get_last_unhidden_line:
  1454. .. rst-class:: classref-method
  1455. :ref:`int<class_int>` **get_last_unhidden_line**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_last_unhidden_line>`
  1456. Returns the last unhidden line in the entire **TextEdit**.
  1457. .. rst-class:: classref-item-separator
  1458. ----
  1459. .. _class_TextEdit_method_get_line:
  1460. .. rst-class:: classref-method
  1461. :ref:`String<class_String>` **get_line**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line>`
  1462. Returns the text of a specific line.
  1463. .. rst-class:: classref-item-separator
  1464. ----
  1465. .. _class_TextEdit_method_get_line_background_color:
  1466. .. rst-class:: classref-method
  1467. :ref:`Color<class_Color>` **get_line_background_color**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_background_color>`
  1468. Returns the current background color of the line. ``Color(0, 0, 0, 0)`` is returned if no color is set.
  1469. .. rst-class:: classref-item-separator
  1470. ----
  1471. .. _class_TextEdit_method_get_line_column_at_pos:
  1472. .. rst-class:: classref-method
  1473. :ref:`Vector2i<class_Vector2i>` **get_line_column_at_pos**\ (\ position\: :ref:`Vector2i<class_Vector2i>`, allow_out_of_bounds\: :ref:`bool<class_bool>` = true\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_column_at_pos>`
  1474. 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``.
  1475. .. rst-class:: classref-item-separator
  1476. ----
  1477. .. _class_TextEdit_method_get_line_count:
  1478. .. rst-class:: classref-method
  1479. :ref:`int<class_int>` **get_line_count**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_count>`
  1480. Returns the number of lines in the text.
  1481. .. rst-class:: classref-item-separator
  1482. ----
  1483. .. _class_TextEdit_method_get_line_gutter_icon:
  1484. .. rst-class:: classref-method
  1485. :ref:`Texture2D<class_Texture2D>` **get_line_gutter_icon**\ (\ line\: :ref:`int<class_int>`, gutter\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_gutter_icon>`
  1486. 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>`).
  1487. .. rst-class:: classref-item-separator
  1488. ----
  1489. .. _class_TextEdit_method_get_line_gutter_item_color:
  1490. .. rst-class:: classref-method
  1491. :ref:`Color<class_Color>` **get_line_gutter_item_color**\ (\ line\: :ref:`int<class_int>`, gutter\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_gutter_item_color>`
  1492. Returns the color currently in ``gutter`` at ``line``.
  1493. .. rst-class:: classref-item-separator
  1494. ----
  1495. .. _class_TextEdit_method_get_line_gutter_metadata:
  1496. .. rst-class:: classref-method
  1497. :ref:`Variant<class_Variant>` **get_line_gutter_metadata**\ (\ line\: :ref:`int<class_int>`, gutter\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_gutter_metadata>`
  1498. Returns the metadata currently in ``gutter`` at ``line``.
  1499. .. rst-class:: classref-item-separator
  1500. ----
  1501. .. _class_TextEdit_method_get_line_gutter_text:
  1502. .. rst-class:: classref-method
  1503. :ref:`String<class_String>` **get_line_gutter_text**\ (\ line\: :ref:`int<class_int>`, gutter\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_gutter_text>`
  1504. 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>`).
  1505. .. rst-class:: classref-item-separator
  1506. ----
  1507. .. _class_TextEdit_method_get_line_height:
  1508. .. rst-class:: classref-method
  1509. :ref:`int<class_int>` **get_line_height**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_height>`
  1510. Returns the maximum value of the line height among all lines.
  1511. \ **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``.
  1512. .. rst-class:: classref-item-separator
  1513. ----
  1514. .. _class_TextEdit_method_get_line_ranges_from_carets:
  1515. .. rst-class:: classref-method
  1516. :ref:`Array<class_Array>`\[:ref:`Vector2i<class_Vector2i>`\] **get_line_ranges_from_carets**\ (\ only_selections\: :ref:`bool<class_bool>` = false, merge_adjacent\: :ref:`bool<class_bool>` = true\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_ranges_from_carets>`
  1517. Returns an :ref:`Array<class_Array>` of line ranges where ``x`` is the first line and ``y`` is the last line. All lines within these ranges will have a caret on them or be part of a selection. Each line will only be part of one line range, even if it has multiple carets on it.
  1518. If a selection's end column (:ref:`get_selection_to_column<class_TextEdit_method_get_selection_to_column>`) is at column ``0``, that line will not be included. If a selection begins on the line after another selection ends and ``merge_adjacent`` is ``true``, or they begin and end on the same line, one line range will include both selections.
  1519. .. rst-class:: classref-item-separator
  1520. ----
  1521. .. _class_TextEdit_method_get_line_width:
  1522. .. rst-class:: classref-method
  1523. :ref:`int<class_int>` **get_line_width**\ (\ line\: :ref:`int<class_int>`, wrap_index\: :ref:`int<class_int>` = -1\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_width>`
  1524. Returns the width in pixels of the ``wrap_index`` on ``line``.
  1525. .. rst-class:: classref-item-separator
  1526. ----
  1527. .. _class_TextEdit_method_get_line_wrap_count:
  1528. .. rst-class:: classref-method
  1529. :ref:`int<class_int>` **get_line_wrap_count**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_wrap_count>`
  1530. Returns the number of times the given line is wrapped.
  1531. .. rst-class:: classref-item-separator
  1532. ----
  1533. .. _class_TextEdit_method_get_line_wrap_index_at_column:
  1534. .. rst-class:: classref-method
  1535. :ref:`int<class_int>` **get_line_wrap_index_at_column**\ (\ line\: :ref:`int<class_int>`, column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_wrap_index_at_column>`
  1536. Returns the wrap index of the given line column.
  1537. .. rst-class:: classref-item-separator
  1538. ----
  1539. .. _class_TextEdit_method_get_line_wrapped_text:
  1540. .. rst-class:: classref-method
  1541. :ref:`PackedStringArray<class_PackedStringArray>` **get_line_wrapped_text**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_line_wrapped_text>`
  1542. Returns an array of :ref:`String<class_String>`\ s representing each wrapped index.
  1543. .. rst-class:: classref-item-separator
  1544. ----
  1545. .. _class_TextEdit_method_get_local_mouse_pos:
  1546. .. rst-class:: classref-method
  1547. :ref:`Vector2<class_Vector2>` **get_local_mouse_pos**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_local_mouse_pos>`
  1548. Returns the local mouse position adjusted for the text direction.
  1549. .. rst-class:: classref-item-separator
  1550. ----
  1551. .. _class_TextEdit_method_get_menu:
  1552. .. rst-class:: classref-method
  1553. :ref:`PopupMenu<class_PopupMenu>` **get_menu**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_menu>`
  1554. Returns the :ref:`PopupMenu<class_PopupMenu>` of this **TextEdit**. By default, this menu is displayed when right-clicking on the **TextEdit**.
  1555. 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:
  1556. .. tabs::
  1557. .. code-tab:: gdscript
  1558. func _ready():
  1559. var menu = get_menu()
  1560. # Remove all items after "Redo".
  1561. menu.item_count = menu.get_item_index(MENU_REDO) + 1
  1562. # Add custom items.
  1563. menu.add_separator()
  1564. menu.add_item("Insert Date", MENU_MAX + 1)
  1565. # Connect callback.
  1566. menu.id_pressed.connect(_on_item_pressed)
  1567. func _on_item_pressed(id):
  1568. if id == MENU_MAX + 1:
  1569. insert_text_at_caret(Time.get_date_string_from_system())
  1570. .. code-tab:: csharp
  1571. public override void _Ready()
  1572. {
  1573. var menu = GetMenu();
  1574. // Remove all items after "Redo".
  1575. menu.ItemCount = menu.GetItemIndex(TextEdit.MenuItems.Redo) + 1;
  1576. // Add custom items.
  1577. menu.AddSeparator();
  1578. menu.AddItem("Insert Date", TextEdit.MenuItems.Max + 1);
  1579. // Add event handler.
  1580. menu.IdPressed += OnItemPressed;
  1581. }
  1582. public void OnItemPressed(int id)
  1583. {
  1584. if (id == TextEdit.MenuItems.Max + 1)
  1585. {
  1586. InsertTextAtCaret(Time.GetDateStringFromSystem());
  1587. }
  1588. }
  1589. \ **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.
  1590. .. rst-class:: classref-item-separator
  1591. ----
  1592. .. _class_TextEdit_method_get_minimap_line_at_pos:
  1593. .. rst-class:: classref-method
  1594. :ref:`int<class_int>` **get_minimap_line_at_pos**\ (\ position\: :ref:`Vector2i<class_Vector2i>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_minimap_line_at_pos>`
  1595. Returns the equivalent minimap line at ``position``.
  1596. .. rst-class:: classref-item-separator
  1597. ----
  1598. .. _class_TextEdit_method_get_minimap_visible_lines:
  1599. .. rst-class:: classref-method
  1600. :ref:`int<class_int>` **get_minimap_visible_lines**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_minimap_visible_lines>`
  1601. Returns the number of lines that may be drawn on the minimap.
  1602. .. rst-class:: classref-item-separator
  1603. ----
  1604. .. _class_TextEdit_method_get_next_visible_line_index_offset_from:
  1605. .. rst-class:: classref-method
  1606. :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| :ref:`๐Ÿ”—<class_TextEdit_method_get_next_visible_line_index_offset_from>`
  1607. 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.
  1608. .. rst-class:: classref-item-separator
  1609. ----
  1610. .. _class_TextEdit_method_get_next_visible_line_offset_from:
  1611. .. rst-class:: classref-method
  1612. :ref:`int<class_int>` **get_next_visible_line_offset_from**\ (\ line\: :ref:`int<class_int>`, visible_amount\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_next_visible_line_offset_from>`
  1613. 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.
  1614. .. rst-class:: classref-item-separator
  1615. ----
  1616. .. _class_TextEdit_method_get_pos_at_line_column:
  1617. .. rst-class:: classref-method
  1618. :ref:`Vector2i<class_Vector2i>` **get_pos_at_line_column**\ (\ line\: :ref:`int<class_int>`, column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_pos_at_line_column>`
  1619. 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.
  1620. \ **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.
  1621. .. rst-class:: classref-item-separator
  1622. ----
  1623. .. _class_TextEdit_method_get_rect_at_line_column:
  1624. .. rst-class:: classref-method
  1625. :ref:`Rect2i<class_Rect2i>` **get_rect_at_line_column**\ (\ line\: :ref:`int<class_int>`, column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_rect_at_line_column>`
  1626. 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.
  1627. \ **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.
  1628. .. rst-class:: classref-item-separator
  1629. ----
  1630. .. _class_TextEdit_method_get_saved_version:
  1631. .. rst-class:: classref-method
  1632. :ref:`int<class_int>` **get_saved_version**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_saved_version>`
  1633. Returns the last tagged saved version from :ref:`tag_saved_version<class_TextEdit_method_tag_saved_version>`.
  1634. .. rst-class:: classref-item-separator
  1635. ----
  1636. .. _class_TextEdit_method_get_scroll_pos_for_line:
  1637. .. rst-class:: classref-method
  1638. :ref:`float<class_float>` **get_scroll_pos_for_line**\ (\ line\: :ref:`int<class_int>`, wrap_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_scroll_pos_for_line>`
  1639. Returns the scroll position for ``wrap_index`` of ``line``.
  1640. .. rst-class:: classref-item-separator
  1641. ----
  1642. .. _class_TextEdit_method_get_selected_text:
  1643. .. rst-class:: classref-method
  1644. :ref:`String<class_String>` **get_selected_text**\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TextEdit_method_get_selected_text>`
  1645. Returns the text inside the selection of a caret, or all the carets if ``caret_index`` is its default value ``-1``.
  1646. .. rst-class:: classref-item-separator
  1647. ----
  1648. .. _class_TextEdit_method_get_selection_at_line_column:
  1649. .. rst-class:: classref-method
  1650. :ref:`int<class_int>` **get_selection_at_line_column**\ (\ line\: :ref:`int<class_int>`, column\: :ref:`int<class_int>`, include_edges\: :ref:`bool<class_bool>` = true, only_selections\: :ref:`bool<class_bool>` = true\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_selection_at_line_column>`
  1651. Returns the caret index of the selection at the given ``line`` and ``column``, or ``-1`` if there is none.
  1652. If ``include_edges`` is ``false``, the position must be inside the selection and not at either end. If ``only_selections`` is ``false``, carets without a selection will also be considered.
  1653. .. rst-class:: classref-item-separator
  1654. ----
  1655. .. _class_TextEdit_method_get_selection_column:
  1656. .. rst-class:: classref-method
  1657. :ref:`int<class_int>` **get_selection_column**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_selection_column>`
  1658. **Deprecated:** Use :ref:`get_selection_origin_column<class_TextEdit_method_get_selection_origin_column>` instead.
  1659. Returns the original start column of the selection.
  1660. .. rst-class:: classref-item-separator
  1661. ----
  1662. .. _class_TextEdit_method_get_selection_from_column:
  1663. .. rst-class:: classref-method
  1664. :ref:`int<class_int>` **get_selection_from_column**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_selection_from_column>`
  1665. Returns the selection begin column. Returns the caret column if there is no selection.
  1666. .. rst-class:: classref-item-separator
  1667. ----
  1668. .. _class_TextEdit_method_get_selection_from_line:
  1669. .. rst-class:: classref-method
  1670. :ref:`int<class_int>` **get_selection_from_line**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_selection_from_line>`
  1671. Returns the selection begin line. Returns the caret line if there is no selection.
  1672. .. rst-class:: classref-item-separator
  1673. ----
  1674. .. _class_TextEdit_method_get_selection_line:
  1675. .. rst-class:: classref-method
  1676. :ref:`int<class_int>` **get_selection_line**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_selection_line>`
  1677. **Deprecated:** Use :ref:`get_selection_origin_line<class_TextEdit_method_get_selection_origin_line>` instead.
  1678. Returns the original start line of the selection.
  1679. .. rst-class:: classref-item-separator
  1680. ----
  1681. .. _class_TextEdit_method_get_selection_mode:
  1682. .. rst-class:: classref-method
  1683. :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **get_selection_mode**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_selection_mode>`
  1684. Returns the current selection mode.
  1685. .. rst-class:: classref-item-separator
  1686. ----
  1687. .. _class_TextEdit_method_get_selection_origin_column:
  1688. .. rst-class:: classref-method
  1689. :ref:`int<class_int>` **get_selection_origin_column**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_selection_origin_column>`
  1690. Returns the origin column of the selection. This is the opposite end from the caret.
  1691. .. rst-class:: classref-item-separator
  1692. ----
  1693. .. _class_TextEdit_method_get_selection_origin_line:
  1694. .. rst-class:: classref-method
  1695. :ref:`int<class_int>` **get_selection_origin_line**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_selection_origin_line>`
  1696. Returns the origin line of the selection. This is the opposite end from the caret.
  1697. .. rst-class:: classref-item-separator
  1698. ----
  1699. .. _class_TextEdit_method_get_selection_to_column:
  1700. .. rst-class:: classref-method
  1701. :ref:`int<class_int>` **get_selection_to_column**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_selection_to_column>`
  1702. Returns the selection end column. Returns the caret column if there is no selection.
  1703. .. rst-class:: classref-item-separator
  1704. ----
  1705. .. _class_TextEdit_method_get_selection_to_line:
  1706. .. rst-class:: classref-method
  1707. :ref:`int<class_int>` **get_selection_to_line**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_selection_to_line>`
  1708. Returns the selection end line. Returns the caret line if there is no selection.
  1709. .. rst-class:: classref-item-separator
  1710. ----
  1711. .. _class_TextEdit_method_get_sorted_carets:
  1712. .. rst-class:: classref-method
  1713. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_sorted_carets**\ (\ include_ignored_carets\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_sorted_carets>`
  1714. Returns the carets sorted by selection beginning from lowest line and column to highest (from top to bottom of text).
  1715. If ``include_ignored_carets`` is ``false``, carets from :ref:`multicaret_edit_ignore_caret<class_TextEdit_method_multicaret_edit_ignore_caret>` will be ignored.
  1716. .. rst-class:: classref-item-separator
  1717. ----
  1718. .. _class_TextEdit_method_get_tab_size:
  1719. .. rst-class:: classref-method
  1720. :ref:`int<class_int>` **get_tab_size**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_tab_size>`
  1721. Returns the **TextEdit**'s' tab size.
  1722. .. rst-class:: classref-item-separator
  1723. ----
  1724. .. _class_TextEdit_method_get_total_gutter_width:
  1725. .. rst-class:: classref-method
  1726. :ref:`int<class_int>` **get_total_gutter_width**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_total_gutter_width>`
  1727. Returns the total width of all gutters and internal padding.
  1728. .. rst-class:: classref-item-separator
  1729. ----
  1730. .. _class_TextEdit_method_get_total_visible_line_count:
  1731. .. rst-class:: classref-method
  1732. :ref:`int<class_int>` **get_total_visible_line_count**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_total_visible_line_count>`
  1733. Returns the number of lines that may be drawn.
  1734. .. rst-class:: classref-item-separator
  1735. ----
  1736. .. _class_TextEdit_method_get_v_scroll_bar:
  1737. .. rst-class:: classref-method
  1738. :ref:`VScrollBar<class_VScrollBar>` **get_v_scroll_bar**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_v_scroll_bar>`
  1739. Returns the :ref:`VScrollBar<class_VScrollBar>` of the **TextEdit**.
  1740. .. rst-class:: classref-item-separator
  1741. ----
  1742. .. _class_TextEdit_method_get_version:
  1743. .. rst-class:: classref-method
  1744. :ref:`int<class_int>` **get_version**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_version>`
  1745. Returns the current version of the **TextEdit**. The version is a count of recorded operations by the undo/redo history.
  1746. .. rst-class:: classref-item-separator
  1747. ----
  1748. .. _class_TextEdit_method_get_visible_line_count:
  1749. .. rst-class:: classref-method
  1750. :ref:`int<class_int>` **get_visible_line_count**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_visible_line_count>`
  1751. Returns the number of visible lines, including wrapped text.
  1752. .. rst-class:: classref-item-separator
  1753. ----
  1754. .. _class_TextEdit_method_get_visible_line_count_in_range:
  1755. .. rst-class:: classref-method
  1756. :ref:`int<class_int>` **get_visible_line_count_in_range**\ (\ from_line\: :ref:`int<class_int>`, to_line\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_visible_line_count_in_range>`
  1757. Returns the total number of visible + wrapped lines between the two lines.
  1758. .. rst-class:: classref-item-separator
  1759. ----
  1760. .. _class_TextEdit_method_get_word_at_pos:
  1761. .. rst-class:: classref-method
  1762. :ref:`String<class_String>` **get_word_at_pos**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_word_at_pos>`
  1763. Returns the word at ``position``.
  1764. .. rst-class:: classref-item-separator
  1765. ----
  1766. .. _class_TextEdit_method_get_word_under_caret:
  1767. .. rst-class:: classref-method
  1768. :ref:`String<class_String>` **get_word_under_caret**\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_get_word_under_caret>`
  1769. Returns a :ref:`String<class_String>` text with the word under the caret's location.
  1770. .. rst-class:: classref-item-separator
  1771. ----
  1772. .. _class_TextEdit_method_has_ime_text:
  1773. .. rst-class:: classref-method
  1774. :ref:`bool<class_bool>` **has_ime_text**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_has_ime_text>`
  1775. Returns ``true`` if the user has text in the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ (IME).
  1776. .. rst-class:: classref-item-separator
  1777. ----
  1778. .. _class_TextEdit_method_has_redo:
  1779. .. rst-class:: classref-method
  1780. :ref:`bool<class_bool>` **has_redo**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_has_redo>`
  1781. Returns ``true`` if a "redo" action is available.
  1782. .. rst-class:: classref-item-separator
  1783. ----
  1784. .. _class_TextEdit_method_has_selection:
  1785. .. rst-class:: classref-method
  1786. :ref:`bool<class_bool>` **has_selection**\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_has_selection>`
  1787. Returns ``true`` if the user has selected text.
  1788. .. rst-class:: classref-item-separator
  1789. ----
  1790. .. _class_TextEdit_method_has_undo:
  1791. .. rst-class:: classref-method
  1792. :ref:`bool<class_bool>` **has_undo**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_has_undo>`
  1793. Returns ``true`` if an "undo" action is available.
  1794. .. rst-class:: classref-item-separator
  1795. ----
  1796. .. _class_TextEdit_method_insert_line_at:
  1797. .. rst-class:: classref-method
  1798. |void| **insert_line_at**\ (\ line\: :ref:`int<class_int>`, text\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_insert_line_at>`
  1799. Inserts a new line with ``text`` at ``line``.
  1800. .. rst-class:: classref-item-separator
  1801. ----
  1802. .. _class_TextEdit_method_insert_text:
  1803. .. rst-class:: classref-method
  1804. |void| **insert_text**\ (\ text\: :ref:`String<class_String>`, line\: :ref:`int<class_int>`, column\: :ref:`int<class_int>`, before_selection_begin\: :ref:`bool<class_bool>` = true, before_selection_end\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_TextEdit_method_insert_text>`
  1805. Inserts the ``text`` at ``line`` and ``column``.
  1806. If ``before_selection_begin`` is ``true``, carets and selections that begin at ``line`` and ``column`` will moved to the end of the inserted text, along with all carets after it.
  1807. If ``before_selection_end`` is ``true``, selections that end at ``line`` and ``column`` will be extended to the end of the inserted text. These parameters can be used to insert text inside of or outside of selections.
  1808. .. rst-class:: classref-item-separator
  1809. ----
  1810. .. _class_TextEdit_method_insert_text_at_caret:
  1811. .. rst-class:: classref-method
  1812. |void| **insert_text_at_caret**\ (\ text\: :ref:`String<class_String>`, caret_index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TextEdit_method_insert_text_at_caret>`
  1813. Insert the specified text at the caret position.
  1814. .. rst-class:: classref-item-separator
  1815. ----
  1816. .. _class_TextEdit_method_is_caret_after_selection_origin:
  1817. .. rst-class:: classref-method
  1818. :ref:`bool<class_bool>` **is_caret_after_selection_origin**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_is_caret_after_selection_origin>`
  1819. Returns ``true`` if the caret of the selection is after the selection origin. This can be used to determine the direction of the selection.
  1820. .. rst-class:: classref-item-separator
  1821. ----
  1822. .. _class_TextEdit_method_is_caret_visible:
  1823. .. rst-class:: classref-method
  1824. :ref:`bool<class_bool>` **is_caret_visible**\ (\ caret_index\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_is_caret_visible>`
  1825. Returns ``true`` if the caret is visible, ``false`` otherwise. A caret will be considered hidden if it is outside the scrollable area when scrolling is enabled.
  1826. \ **Note:** :ref:`is_caret_visible<class_TextEdit_method_is_caret_visible>` does not account for a caret being off-screen if it is still within the scrollable area. It will return ``true`` even if the caret is off-screen as long as it meets **TextEdit**'s own conditions for being visible. This includes uses of :ref:`scroll_fit_content_width<class_TextEdit_property_scroll_fit_content_width>` and :ref:`scroll_fit_content_height<class_TextEdit_property_scroll_fit_content_height>` that cause the **TextEdit** to expand beyond the viewport's bounds.
  1827. .. rst-class:: classref-item-separator
  1828. ----
  1829. .. _class_TextEdit_method_is_dragging_cursor:
  1830. .. rst-class:: classref-method
  1831. :ref:`bool<class_bool>` **is_dragging_cursor**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_is_dragging_cursor>`
  1832. Returns ``true`` if the user is dragging their mouse for scrolling, selecting, or text dragging.
  1833. .. rst-class:: classref-item-separator
  1834. ----
  1835. .. _class_TextEdit_method_is_gutter_clickable:
  1836. .. rst-class:: classref-method
  1837. :ref:`bool<class_bool>` **is_gutter_clickable**\ (\ gutter\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_is_gutter_clickable>`
  1838. Returns whether the gutter is clickable.
  1839. .. rst-class:: classref-item-separator
  1840. ----
  1841. .. _class_TextEdit_method_is_gutter_drawn:
  1842. .. rst-class:: classref-method
  1843. :ref:`bool<class_bool>` **is_gutter_drawn**\ (\ gutter\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_is_gutter_drawn>`
  1844. Returns whether the gutter is currently drawn.
  1845. .. rst-class:: classref-item-separator
  1846. ----
  1847. .. _class_TextEdit_method_is_gutter_overwritable:
  1848. .. rst-class:: classref-method
  1849. :ref:`bool<class_bool>` **is_gutter_overwritable**\ (\ gutter\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_is_gutter_overwritable>`
  1850. Returns whether the gutter is overwritable.
  1851. .. rst-class:: classref-item-separator
  1852. ----
  1853. .. _class_TextEdit_method_is_in_mulitcaret_edit:
  1854. .. rst-class:: classref-method
  1855. :ref:`bool<class_bool>` **is_in_mulitcaret_edit**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_is_in_mulitcaret_edit>`
  1856. Returns ``true`` if a :ref:`begin_multicaret_edit<class_TextEdit_method_begin_multicaret_edit>` has been called and :ref:`end_multicaret_edit<class_TextEdit_method_end_multicaret_edit>` has not yet been called.
  1857. .. rst-class:: classref-item-separator
  1858. ----
  1859. .. _class_TextEdit_method_is_line_gutter_clickable:
  1860. .. rst-class:: classref-method
  1861. :ref:`bool<class_bool>` **is_line_gutter_clickable**\ (\ line\: :ref:`int<class_int>`, gutter\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_is_line_gutter_clickable>`
  1862. Returns whether the gutter on the given line is clickable.
  1863. .. rst-class:: classref-item-separator
  1864. ----
  1865. .. _class_TextEdit_method_is_line_wrapped:
  1866. .. rst-class:: classref-method
  1867. :ref:`bool<class_bool>` **is_line_wrapped**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_is_line_wrapped>`
  1868. Returns if the given line is wrapped.
  1869. .. rst-class:: classref-item-separator
  1870. ----
  1871. .. _class_TextEdit_method_is_menu_visible:
  1872. .. rst-class:: classref-method
  1873. :ref:`bool<class_bool>` **is_menu_visible**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_is_menu_visible>`
  1874. Returns whether the menu is visible. Use this instead of ``get_menu().visible`` to improve performance (so the creation of the menu is avoided).
  1875. .. rst-class:: classref-item-separator
  1876. ----
  1877. .. _class_TextEdit_method_is_mouse_over_selection:
  1878. .. rst-class:: classref-method
  1879. :ref:`bool<class_bool>` **is_mouse_over_selection**\ (\ edges\: :ref:`bool<class_bool>`, caret_index\: :ref:`int<class_int>` = -1\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_is_mouse_over_selection>`
  1880. Returns whether the mouse is over selection. If ``edges`` is ``true``, the edges are considered part of the selection.
  1881. .. rst-class:: classref-item-separator
  1882. ----
  1883. .. _class_TextEdit_method_is_overtype_mode_enabled:
  1884. .. rst-class:: classref-method
  1885. :ref:`bool<class_bool>` **is_overtype_mode_enabled**\ (\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_is_overtype_mode_enabled>`
  1886. Returns whether the user is in overtype mode.
  1887. .. rst-class:: classref-item-separator
  1888. ----
  1889. .. _class_TextEdit_method_menu_option:
  1890. .. rst-class:: classref-method
  1891. |void| **menu_option**\ (\ option\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_menu_option>`
  1892. Executes a given action as defined in the :ref:`MenuItems<enum_TextEdit_MenuItems>` enum.
  1893. .. rst-class:: classref-item-separator
  1894. ----
  1895. .. _class_TextEdit_method_merge_gutters:
  1896. .. rst-class:: classref-method
  1897. |void| **merge_gutters**\ (\ from_line\: :ref:`int<class_int>`, to_line\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_merge_gutters>`
  1898. Merge the gutters from ``from_line`` into ``to_line``. Only overwritable gutters will be copied.
  1899. .. rst-class:: classref-item-separator
  1900. ----
  1901. .. _class_TextEdit_method_merge_overlapping_carets:
  1902. .. rst-class:: classref-method
  1903. |void| **merge_overlapping_carets**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_merge_overlapping_carets>`
  1904. Merges any overlapping carets. Will favor the newest caret, or the caret with a selection.
  1905. If :ref:`is_in_mulitcaret_edit<class_TextEdit_method_is_in_mulitcaret_edit>` is ``true``, the merge will be queued to happen at the end of the multicaret edit. See :ref:`begin_multicaret_edit<class_TextEdit_method_begin_multicaret_edit>` and :ref:`end_multicaret_edit<class_TextEdit_method_end_multicaret_edit>`.
  1906. \ **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.
  1907. .. rst-class:: classref-item-separator
  1908. ----
  1909. .. _class_TextEdit_method_multicaret_edit_ignore_caret:
  1910. .. rst-class:: classref-method
  1911. :ref:`bool<class_bool>` **multicaret_edit_ignore_caret**\ (\ caret_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_multicaret_edit_ignore_caret>`
  1912. Returns ``true`` if the given ``caret_index`` should be ignored as part of a multicaret edit. See :ref:`begin_multicaret_edit<class_TextEdit_method_begin_multicaret_edit>` and :ref:`end_multicaret_edit<class_TextEdit_method_end_multicaret_edit>`. Carets that should be ignored are ones that were part of removed text and will likely be merged at the end of the edit, or carets that were added during the edit.
  1913. It is recommended to ``continue`` within a loop iterating on multiple carets if a caret should be ignored.
  1914. .. rst-class:: classref-item-separator
  1915. ----
  1916. .. _class_TextEdit_method_paste:
  1917. .. rst-class:: classref-method
  1918. |void| **paste**\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TextEdit_method_paste>`
  1919. Paste at the current location. Can be overridden with :ref:`_paste<class_TextEdit_private_method__paste>`.
  1920. .. rst-class:: classref-item-separator
  1921. ----
  1922. .. _class_TextEdit_method_paste_primary_clipboard:
  1923. .. rst-class:: classref-method
  1924. |void| **paste_primary_clipboard**\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TextEdit_method_paste_primary_clipboard>`
  1925. Pastes the primary clipboard.
  1926. .. rst-class:: classref-item-separator
  1927. ----
  1928. .. _class_TextEdit_method_redo:
  1929. .. rst-class:: classref-method
  1930. |void| **redo**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_redo>`
  1931. Perform redo operation.
  1932. .. rst-class:: classref-item-separator
  1933. ----
  1934. .. _class_TextEdit_method_remove_caret:
  1935. .. rst-class:: classref-method
  1936. |void| **remove_caret**\ (\ caret\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_remove_caret>`
  1937. Removes the given caret index.
  1938. \ **Note:** This can result in adjustment of all other caret indices.
  1939. .. rst-class:: classref-item-separator
  1940. ----
  1941. .. _class_TextEdit_method_remove_gutter:
  1942. .. rst-class:: classref-method
  1943. |void| **remove_gutter**\ (\ gutter\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_remove_gutter>`
  1944. Removes the gutter from this **TextEdit**.
  1945. .. rst-class:: classref-item-separator
  1946. ----
  1947. .. _class_TextEdit_method_remove_line_at:
  1948. .. rst-class:: classref-method
  1949. |void| **remove_line_at**\ (\ line\: :ref:`int<class_int>`, move_carets_down\: :ref:`bool<class_bool>` = true\ ) :ref:`๐Ÿ”—<class_TextEdit_method_remove_line_at>`
  1950. Removes the line of text at ``line``. Carets on this line will attempt to match their previous visual x position.
  1951. If ``move_carets_down`` is ``true`` carets will move to the next line down, otherwise carets will move up.
  1952. .. rst-class:: classref-item-separator
  1953. ----
  1954. .. _class_TextEdit_method_remove_secondary_carets:
  1955. .. rst-class:: classref-method
  1956. |void| **remove_secondary_carets**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_remove_secondary_carets>`
  1957. Removes all additional carets.
  1958. .. rst-class:: classref-item-separator
  1959. ----
  1960. .. _class_TextEdit_method_remove_text:
  1961. .. rst-class:: classref-method
  1962. |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>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_remove_text>`
  1963. Removes text between the given positions.
  1964. .. rst-class:: classref-item-separator
  1965. ----
  1966. .. _class_TextEdit_method_search:
  1967. .. rst-class:: classref-method
  1968. :ref:`Vector2i<class_Vector2i>` **search**\ (\ text\: :ref:`String<class_String>`, flags\: :ref:`int<class_int>`, from_line\: :ref:`int<class_int>`, from_column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TextEdit_method_search>`
  1969. Perform a search inside the text. Search flags can be specified in the :ref:`SearchFlags<enum_TextEdit_SearchFlags>` enum.
  1970. In the returned vector, ``x`` is the column, ``y`` is the line. If no results are found, both are equal to ``-1``.
  1971. .. tabs::
  1972. .. code-tab:: gdscript
  1973. var result = search("print", SEARCH_WHOLE_WORDS, 0, 0)
  1974. if result.x != -1:
  1975. # Result found.
  1976. var line_number = result.y
  1977. var column_number = result.x
  1978. .. code-tab:: csharp
  1979. Vector2I result = Search("print", (uint)TextEdit.SearchFlags.WholeWords, 0, 0);
  1980. if (result.X != -1)
  1981. {
  1982. // Result found.
  1983. int lineNumber = result.Y;
  1984. int columnNumber = result.X;
  1985. }
  1986. .. rst-class:: classref-item-separator
  1987. ----
  1988. .. _class_TextEdit_method_select:
  1989. .. rst-class:: classref-method
  1990. |void| **select**\ (\ origin_line\: :ref:`int<class_int>`, origin_column\: :ref:`int<class_int>`, caret_line\: :ref:`int<class_int>`, caret_column\: :ref:`int<class_int>`, caret_index\: :ref:`int<class_int>` = 0\ ) :ref:`๐Ÿ”—<class_TextEdit_method_select>`
  1991. Selects text from ``origin_line`` and ``origin_column`` to ``caret_line`` and ``caret_column`` for the given ``caret_index``. This moves the selection origin and the caret. If the positions are the same, the selection will be deselected.
  1992. If :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` is ``false``, no selection will occur.
  1993. \ **Note:** If supporting multiple carets this will not check for any overlap. See :ref:`merge_overlapping_carets<class_TextEdit_method_merge_overlapping_carets>`.
  1994. .. rst-class:: classref-item-separator
  1995. ----
  1996. .. _class_TextEdit_method_select_all:
  1997. .. rst-class:: classref-method
  1998. |void| **select_all**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_select_all>`
  1999. Select all the text.
  2000. If :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` is ``false``, no selection will occur.
  2001. .. rst-class:: classref-item-separator
  2002. ----
  2003. .. _class_TextEdit_method_select_word_under_caret:
  2004. .. rst-class:: classref-method
  2005. |void| **select_word_under_caret**\ (\ caret_index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TextEdit_method_select_word_under_caret>`
  2006. Selects the word under the caret.
  2007. .. rst-class:: classref-item-separator
  2008. ----
  2009. .. _class_TextEdit_method_set_caret_column:
  2010. .. rst-class:: classref-method
  2011. |void| **set_caret_column**\ (\ column\: :ref:`int<class_int>`, adjust_viewport\: :ref:`bool<class_bool>` = true, caret_index\: :ref:`int<class_int>` = 0\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_caret_column>`
  2012. Moves the caret to the specified ``column`` index.
  2013. If ``adjust_viewport`` is ``true``, the viewport will center at the caret position after the move occurs.
  2014. \ **Note:** If supporting multiple carets this will not check for any overlap. See :ref:`merge_overlapping_carets<class_TextEdit_method_merge_overlapping_carets>`.
  2015. .. rst-class:: classref-item-separator
  2016. ----
  2017. .. _class_TextEdit_method_set_caret_line:
  2018. .. rst-class:: classref-method
  2019. |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\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_caret_line>`
  2020. Moves the caret to the specified ``line`` index. The caret column will be moved to the same visual position it was at the last time :ref:`set_caret_column<class_TextEdit_method_set_caret_column>` was called, or clamped to the end of the line.
  2021. If ``adjust_viewport`` is ``true``, the viewport will center at the caret position after the move occurs.
  2022. If ``can_be_hidden`` is ``true``, the specified ``line`` can be hidden.
  2023. If ``wrap_index`` is ``-1``, the caret column will be clamped to the ``line``'s length. If ``wrap_index`` is greater than ``-1``, the column will be moved to attempt to match the visual x position on the line's ``wrap_index`` to the position from the last time :ref:`set_caret_column<class_TextEdit_method_set_caret_column>` was called.
  2024. \ **Note:** If supporting multiple carets this will not check for any overlap. See :ref:`merge_overlapping_carets<class_TextEdit_method_merge_overlapping_carets>`.
  2025. .. rst-class:: classref-item-separator
  2026. ----
  2027. .. _class_TextEdit_method_set_gutter_clickable:
  2028. .. rst-class:: classref-method
  2029. |void| **set_gutter_clickable**\ (\ gutter\: :ref:`int<class_int>`, clickable\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_gutter_clickable>`
  2030. Sets the gutter as clickable. This will change the mouse cursor to a pointing hand when hovering over the gutter.
  2031. .. rst-class:: classref-item-separator
  2032. ----
  2033. .. _class_TextEdit_method_set_gutter_custom_draw:
  2034. .. rst-class:: classref-method
  2035. |void| **set_gutter_custom_draw**\ (\ column\: :ref:`int<class_int>`, draw_callback\: :ref:`Callable<class_Callable>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_gutter_custom_draw>`
  2036. 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>`).
  2037. .. rst-class:: classref-item-separator
  2038. ----
  2039. .. _class_TextEdit_method_set_gutter_draw:
  2040. .. rst-class:: classref-method
  2041. |void| **set_gutter_draw**\ (\ gutter\: :ref:`int<class_int>`, draw\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_gutter_draw>`
  2042. Sets whether the gutter should be drawn.
  2043. .. rst-class:: classref-item-separator
  2044. ----
  2045. .. _class_TextEdit_method_set_gutter_name:
  2046. .. rst-class:: classref-method
  2047. |void| **set_gutter_name**\ (\ gutter\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_gutter_name>`
  2048. Sets the name of the gutter.
  2049. .. rst-class:: classref-item-separator
  2050. ----
  2051. .. _class_TextEdit_method_set_gutter_overwritable:
  2052. .. rst-class:: classref-method
  2053. |void| **set_gutter_overwritable**\ (\ gutter\: :ref:`int<class_int>`, overwritable\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_gutter_overwritable>`
  2054. Sets the gutter to overwritable. See :ref:`merge_gutters<class_TextEdit_method_merge_gutters>`.
  2055. .. rst-class:: classref-item-separator
  2056. ----
  2057. .. _class_TextEdit_method_set_gutter_type:
  2058. .. rst-class:: classref-method
  2059. |void| **set_gutter_type**\ (\ gutter\: :ref:`int<class_int>`, type\: :ref:`GutterType<enum_TextEdit_GutterType>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_gutter_type>`
  2060. Sets the type of gutter. Gutters can contain icons, text, or custom visuals. See :ref:`GutterType<enum_TextEdit_GutterType>` for options.
  2061. .. rst-class:: classref-item-separator
  2062. ----
  2063. .. _class_TextEdit_method_set_gutter_width:
  2064. .. rst-class:: classref-method
  2065. |void| **set_gutter_width**\ (\ gutter\: :ref:`int<class_int>`, width\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_gutter_width>`
  2066. Set the width of the gutter.
  2067. .. rst-class:: classref-item-separator
  2068. ----
  2069. .. _class_TextEdit_method_set_line:
  2070. .. rst-class:: classref-method
  2071. |void| **set_line**\ (\ line\: :ref:`int<class_int>`, new_text\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_line>`
  2072. Sets the text for a specific ``line``.
  2073. Carets on the line will attempt to keep their visual x position.
  2074. .. rst-class:: classref-item-separator
  2075. ----
  2076. .. _class_TextEdit_method_set_line_as_center_visible:
  2077. .. rst-class:: classref-method
  2078. |void| **set_line_as_center_visible**\ (\ line\: :ref:`int<class_int>`, wrap_index\: :ref:`int<class_int>` = 0\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_line_as_center_visible>`
  2079. Positions the ``wrap_index`` of ``line`` at the center of the viewport.
  2080. .. rst-class:: classref-item-separator
  2081. ----
  2082. .. _class_TextEdit_method_set_line_as_first_visible:
  2083. .. rst-class:: classref-method
  2084. |void| **set_line_as_first_visible**\ (\ line\: :ref:`int<class_int>`, wrap_index\: :ref:`int<class_int>` = 0\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_line_as_first_visible>`
  2085. Positions the ``wrap_index`` of ``line`` at the top of the viewport.
  2086. .. rst-class:: classref-item-separator
  2087. ----
  2088. .. _class_TextEdit_method_set_line_as_last_visible:
  2089. .. rst-class:: classref-method
  2090. |void| **set_line_as_last_visible**\ (\ line\: :ref:`int<class_int>`, wrap_index\: :ref:`int<class_int>` = 0\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_line_as_last_visible>`
  2091. Positions the ``wrap_index`` of ``line`` at the bottom of the viewport.
  2092. .. rst-class:: classref-item-separator
  2093. ----
  2094. .. _class_TextEdit_method_set_line_background_color:
  2095. .. rst-class:: classref-method
  2096. |void| **set_line_background_color**\ (\ line\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_line_background_color>`
  2097. Sets the current background color of the line. Set to ``Color(0, 0, 0, 0)`` for no color.
  2098. .. rst-class:: classref-item-separator
  2099. ----
  2100. .. _class_TextEdit_method_set_line_gutter_clickable:
  2101. .. rst-class:: classref-method
  2102. |void| **set_line_gutter_clickable**\ (\ line\: :ref:`int<class_int>`, gutter\: :ref:`int<class_int>`, clickable\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_line_gutter_clickable>`
  2103. If ``clickable`` is ``true``, makes the ``gutter`` on ``line`` clickable. See :ref:`gutter_clicked<class_TextEdit_signal_gutter_clicked>`.
  2104. .. rst-class:: classref-item-separator
  2105. ----
  2106. .. _class_TextEdit_method_set_line_gutter_icon:
  2107. .. rst-class:: classref-method
  2108. |void| **set_line_gutter_icon**\ (\ line\: :ref:`int<class_int>`, gutter\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_line_gutter_icon>`
  2109. 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>`).
  2110. .. rst-class:: classref-item-separator
  2111. ----
  2112. .. _class_TextEdit_method_set_line_gutter_item_color:
  2113. .. rst-class:: classref-method
  2114. |void| **set_line_gutter_item_color**\ (\ line\: :ref:`int<class_int>`, gutter\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_line_gutter_item_color>`
  2115. Sets the color for ``gutter`` on ``line`` to ``color``.
  2116. .. rst-class:: classref-item-separator
  2117. ----
  2118. .. _class_TextEdit_method_set_line_gutter_metadata:
  2119. .. rst-class:: classref-method
  2120. |void| **set_line_gutter_metadata**\ (\ line\: :ref:`int<class_int>`, gutter\: :ref:`int<class_int>`, metadata\: :ref:`Variant<class_Variant>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_line_gutter_metadata>`
  2121. Sets the metadata for ``gutter`` on ``line`` to ``metadata``.
  2122. .. rst-class:: classref-item-separator
  2123. ----
  2124. .. _class_TextEdit_method_set_line_gutter_text:
  2125. .. rst-class:: classref-method
  2126. |void| **set_line_gutter_text**\ (\ line\: :ref:`int<class_int>`, gutter\: :ref:`int<class_int>`, text\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_line_gutter_text>`
  2127. 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>`).
  2128. .. rst-class:: classref-item-separator
  2129. ----
  2130. .. _class_TextEdit_method_set_overtype_mode_enabled:
  2131. .. rst-class:: classref-method
  2132. |void| **set_overtype_mode_enabled**\ (\ enabled\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_overtype_mode_enabled>`
  2133. If ``true``, sets the user into overtype mode. When the user types in this mode, it will override existing text.
  2134. .. rst-class:: classref-item-separator
  2135. ----
  2136. .. _class_TextEdit_method_set_search_flags:
  2137. .. rst-class:: classref-method
  2138. |void| **set_search_flags**\ (\ flags\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_search_flags>`
  2139. 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.
  2140. .. rst-class:: classref-item-separator
  2141. ----
  2142. .. _class_TextEdit_method_set_search_text:
  2143. .. rst-class:: classref-method
  2144. |void| **set_search_text**\ (\ search_text\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_search_text>`
  2145. Sets the search text. See :ref:`set_search_flags<class_TextEdit_method_set_search_flags>`.
  2146. .. rst-class:: classref-item-separator
  2147. ----
  2148. .. _class_TextEdit_method_set_selection_mode:
  2149. .. rst-class:: classref-method
  2150. |void| **set_selection_mode**\ (\ mode\: :ref:`SelectionMode<enum_TextEdit_SelectionMode>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_selection_mode>`
  2151. Sets the current selection mode.
  2152. .. rst-class:: classref-item-separator
  2153. ----
  2154. .. _class_TextEdit_method_set_selection_origin_column:
  2155. .. rst-class:: classref-method
  2156. |void| **set_selection_origin_column**\ (\ column\: :ref:`int<class_int>`, caret_index\: :ref:`int<class_int>` = 0\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_selection_origin_column>`
  2157. Sets the selection origin column to the ``column`` for the given ``caret_index``. If the selection origin is moved to the caret position, the selection will deselect.
  2158. .. rst-class:: classref-item-separator
  2159. ----
  2160. .. _class_TextEdit_method_set_selection_origin_line:
  2161. .. rst-class:: classref-method
  2162. |void| **set_selection_origin_line**\ (\ line\: :ref:`int<class_int>`, can_be_hidden\: :ref:`bool<class_bool>` = true, wrap_index\: :ref:`int<class_int>` = -1, caret_index\: :ref:`int<class_int>` = 0\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_selection_origin_line>`
  2163. Sets the selection origin line to the ``line`` for the given ``caret_index``. If the selection origin is moved to the caret position, the selection will deselect.
  2164. If ``can_be_hidden`` is ``false``, The line will be set to the nearest unhidden line below or above.
  2165. If ``wrap_index`` is ``-1``, the selection origin column will be clamped to the ``line``'s length. If ``wrap_index`` is greater than ``-1``, the column will be moved to attempt to match the visual x position on the line's ``wrap_index`` to the position from the last time :ref:`set_selection_origin_column<class_TextEdit_method_set_selection_origin_column>` or :ref:`select<class_TextEdit_method_select>` was called.
  2166. .. rst-class:: classref-item-separator
  2167. ----
  2168. .. _class_TextEdit_method_set_tab_size:
  2169. .. rst-class:: classref-method
  2170. |void| **set_tab_size**\ (\ size\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_tab_size>`
  2171. Sets the tab size for the **TextEdit** to use.
  2172. .. rst-class:: classref-item-separator
  2173. ----
  2174. .. _class_TextEdit_method_set_tooltip_request_func:
  2175. .. rst-class:: classref-method
  2176. |void| **set_tooltip_request_func**\ (\ callback\: :ref:`Callable<class_Callable>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_set_tooltip_request_func>`
  2177. Provide custom tooltip text. The callback method must take the following args: ``hovered_word: String``.
  2178. .. rst-class:: classref-item-separator
  2179. ----
  2180. .. _class_TextEdit_method_skip_selection_for_next_occurrence:
  2181. .. rst-class:: classref-method
  2182. |void| **skip_selection_for_next_occurrence**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_skip_selection_for_next_occurrence>`
  2183. 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.
  2184. .. rst-class:: classref-item-separator
  2185. ----
  2186. .. _class_TextEdit_method_start_action:
  2187. .. rst-class:: classref-method
  2188. |void| **start_action**\ (\ action\: :ref:`EditAction<enum_TextEdit_EditAction>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_start_action>`
  2189. Starts an action, will end the current action if ``action`` is different.
  2190. 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.
  2191. .. rst-class:: classref-item-separator
  2192. ----
  2193. .. _class_TextEdit_method_swap_lines:
  2194. .. rst-class:: classref-method
  2195. |void| **swap_lines**\ (\ from_line\: :ref:`int<class_int>`, to_line\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TextEdit_method_swap_lines>`
  2196. Swaps the two lines. Carets will be swapped with the lines.
  2197. .. rst-class:: classref-item-separator
  2198. ----
  2199. .. _class_TextEdit_method_tag_saved_version:
  2200. .. rst-class:: classref-method
  2201. |void| **tag_saved_version**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_tag_saved_version>`
  2202. Tag the current version as saved.
  2203. .. rst-class:: classref-item-separator
  2204. ----
  2205. .. _class_TextEdit_method_undo:
  2206. .. rst-class:: classref-method
  2207. |void| **undo**\ (\ ) :ref:`๐Ÿ”—<class_TextEdit_method_undo>`
  2208. Perform undo operation.
  2209. .. rst-class:: classref-section-separator
  2210. ----
  2211. .. rst-class:: classref-descriptions-group
  2212. Theme Property Descriptions
  2213. ---------------------------
  2214. .. _class_TextEdit_theme_color_background_color:
  2215. .. rst-class:: classref-themeproperty
  2216. :ref:`Color<class_Color>` **background_color** = ``Color(0, 0, 0, 0)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_background_color>`
  2217. Sets the background :ref:`Color<class_Color>` of this **TextEdit**.
  2218. .. rst-class:: classref-item-separator
  2219. ----
  2220. .. _class_TextEdit_theme_color_caret_background_color:
  2221. .. rst-class:: classref-themeproperty
  2222. :ref:`Color<class_Color>` **caret_background_color** = ``Color(0, 0, 0, 1)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_caret_background_color>`
  2223. :ref:`Color<class_Color>` of the text behind the caret when using a block caret.
  2224. .. rst-class:: classref-item-separator
  2225. ----
  2226. .. _class_TextEdit_theme_color_caret_color:
  2227. .. rst-class:: classref-themeproperty
  2228. :ref:`Color<class_Color>` **caret_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_caret_color>`
  2229. :ref:`Color<class_Color>` of the caret. This can be set to a fully transparent color to hide the caret entirely.
  2230. .. rst-class:: classref-item-separator
  2231. ----
  2232. .. _class_TextEdit_theme_color_current_line_color:
  2233. .. rst-class:: classref-themeproperty
  2234. :ref:`Color<class_Color>` **current_line_color** = ``Color(0.25, 0.25, 0.26, 0.8)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_current_line_color>`
  2235. Background :ref:`Color<class_Color>` of the line containing the caret.
  2236. .. rst-class:: classref-item-separator
  2237. ----
  2238. .. _class_TextEdit_theme_color_font_color:
  2239. .. rst-class:: classref-themeproperty
  2240. :ref:`Color<class_Color>` **font_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_font_color>`
  2241. Sets the font :ref:`Color<class_Color>`.
  2242. .. rst-class:: classref-item-separator
  2243. ----
  2244. .. _class_TextEdit_theme_color_font_outline_color:
  2245. .. rst-class:: classref-themeproperty
  2246. :ref:`Color<class_Color>` **font_outline_color** = ``Color(0, 0, 0, 1)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_font_outline_color>`
  2247. The tint of text outline of the **TextEdit**.
  2248. .. rst-class:: classref-item-separator
  2249. ----
  2250. .. _class_TextEdit_theme_color_font_placeholder_color:
  2251. .. rst-class:: classref-themeproperty
  2252. :ref:`Color<class_Color>` **font_placeholder_color** = ``Color(0.875, 0.875, 0.875, 0.6)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_font_placeholder_color>`
  2253. Font color for :ref:`placeholder_text<class_TextEdit_property_placeholder_text>`.
  2254. .. rst-class:: classref-item-separator
  2255. ----
  2256. .. _class_TextEdit_theme_color_font_readonly_color:
  2257. .. rst-class:: classref-themeproperty
  2258. :ref:`Color<class_Color>` **font_readonly_color** = ``Color(0.875, 0.875, 0.875, 0.5)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_font_readonly_color>`
  2259. Sets the font :ref:`Color<class_Color>` when :ref:`editable<class_TextEdit_property_editable>` is disabled.
  2260. .. rst-class:: classref-item-separator
  2261. ----
  2262. .. _class_TextEdit_theme_color_font_selected_color:
  2263. .. rst-class:: classref-themeproperty
  2264. :ref:`Color<class_Color>` **font_selected_color** = ``Color(0, 0, 0, 0)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_font_selected_color>`
  2265. Sets the :ref:`Color<class_Color>` of the selected text. If equal to ``Color(0, 0, 0, 0)``, it will be ignored.
  2266. .. rst-class:: classref-item-separator
  2267. ----
  2268. .. _class_TextEdit_theme_color_search_result_border_color:
  2269. .. rst-class:: classref-themeproperty
  2270. :ref:`Color<class_Color>` **search_result_border_color** = ``Color(0.3, 0.3, 0.3, 0.4)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_search_result_border_color>`
  2271. :ref:`Color<class_Color>` of the border around text that matches the search query.
  2272. .. rst-class:: classref-item-separator
  2273. ----
  2274. .. _class_TextEdit_theme_color_search_result_color:
  2275. .. rst-class:: classref-themeproperty
  2276. :ref:`Color<class_Color>` **search_result_color** = ``Color(0.3, 0.3, 0.3, 1)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_search_result_color>`
  2277. :ref:`Color<class_Color>` behind the text that matches the search query.
  2278. .. rst-class:: classref-item-separator
  2279. ----
  2280. .. _class_TextEdit_theme_color_selection_color:
  2281. .. rst-class:: classref-themeproperty
  2282. :ref:`Color<class_Color>` **selection_color** = ``Color(0.5, 0.5, 0.5, 1)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_selection_color>`
  2283. Sets the highlight :ref:`Color<class_Color>` of text selections.
  2284. .. rst-class:: classref-item-separator
  2285. ----
  2286. .. _class_TextEdit_theme_color_word_highlighted_color:
  2287. .. rst-class:: classref-themeproperty
  2288. :ref:`Color<class_Color>` **word_highlighted_color** = ``Color(0.5, 0.5, 0.5, 0.25)`` :ref:`๐Ÿ”—<class_TextEdit_theme_color_word_highlighted_color>`
  2289. Sets the highlight :ref:`Color<class_Color>` of multiple occurrences. :ref:`highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` has to be enabled.
  2290. .. rst-class:: classref-item-separator
  2291. ----
  2292. .. _class_TextEdit_theme_constant_caret_width:
  2293. .. rst-class:: classref-themeproperty
  2294. :ref:`int<class_int>` **caret_width** = ``1`` :ref:`๐Ÿ”—<class_TextEdit_theme_constant_caret_width>`
  2295. 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.
  2296. .. rst-class:: classref-item-separator
  2297. ----
  2298. .. _class_TextEdit_theme_constant_line_spacing:
  2299. .. rst-class:: classref-themeproperty
  2300. :ref:`int<class_int>` **line_spacing** = ``4`` :ref:`๐Ÿ”—<class_TextEdit_theme_constant_line_spacing>`
  2301. Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
  2302. .. rst-class:: classref-item-separator
  2303. ----
  2304. .. _class_TextEdit_theme_constant_outline_size:
  2305. .. rst-class:: classref-themeproperty
  2306. :ref:`int<class_int>` **outline_size** = ``0`` :ref:`๐Ÿ”—<class_TextEdit_theme_constant_outline_size>`
  2307. The size of the text outline.
  2308. \ **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.
  2309. .. rst-class:: classref-item-separator
  2310. ----
  2311. .. _class_TextEdit_theme_font_font:
  2312. .. rst-class:: classref-themeproperty
  2313. :ref:`Font<class_Font>` **font** :ref:`๐Ÿ”—<class_TextEdit_theme_font_font>`
  2314. Sets the default :ref:`Font<class_Font>`.
  2315. .. rst-class:: classref-item-separator
  2316. ----
  2317. .. _class_TextEdit_theme_font_size_font_size:
  2318. .. rst-class:: classref-themeproperty
  2319. :ref:`int<class_int>` **font_size** :ref:`๐Ÿ”—<class_TextEdit_theme_font_size_font_size>`
  2320. Sets default font size.
  2321. .. rst-class:: classref-item-separator
  2322. ----
  2323. .. _class_TextEdit_theme_icon_space:
  2324. .. rst-class:: classref-themeproperty
  2325. :ref:`Texture2D<class_Texture2D>` **space** :ref:`๐Ÿ”—<class_TextEdit_theme_icon_space>`
  2326. Sets a custom :ref:`Texture2D<class_Texture2D>` for space text characters.
  2327. .. rst-class:: classref-item-separator
  2328. ----
  2329. .. _class_TextEdit_theme_icon_tab:
  2330. .. rst-class:: classref-themeproperty
  2331. :ref:`Texture2D<class_Texture2D>` **tab** :ref:`๐Ÿ”—<class_TextEdit_theme_icon_tab>`
  2332. Sets a custom :ref:`Texture2D<class_Texture2D>` for tab text characters.
  2333. .. rst-class:: classref-item-separator
  2334. ----
  2335. .. _class_TextEdit_theme_style_focus:
  2336. .. rst-class:: classref-themeproperty
  2337. :ref:`StyleBox<class_StyleBox>` **focus** :ref:`๐Ÿ”—<class_TextEdit_theme_style_focus>`
  2338. 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.
  2339. .. rst-class:: classref-item-separator
  2340. ----
  2341. .. _class_TextEdit_theme_style_normal:
  2342. .. rst-class:: classref-themeproperty
  2343. :ref:`StyleBox<class_StyleBox>` **normal** :ref:`๐Ÿ”—<class_TextEdit_theme_style_normal>`
  2344. Sets the :ref:`StyleBox<class_StyleBox>` of this **TextEdit**.
  2345. .. rst-class:: classref-item-separator
  2346. ----
  2347. .. _class_TextEdit_theme_style_read_only:
  2348. .. rst-class:: classref-themeproperty
  2349. :ref:`StyleBox<class_StyleBox>` **read_only** :ref:`๐Ÿ”—<class_TextEdit_theme_style_read_only>`
  2350. Sets the :ref:`StyleBox<class_StyleBox>` of this **TextEdit** when :ref:`editable<class_TextEdit_property_editable>` is disabled.
  2351. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  2352. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  2353. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  2354. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  2355. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  2356. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  2357. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  2358. .. |void| replace:: :abbr:`void (No return value.)`