ÿØÿà JFIF    ÿÛ „ !.%+&8&+/1555$;@;4?.451 4,$,44444444444414444444444444444444444444444444444444ÿÀ  á á" ÿÄ     ÿÄ ?    !1AQaq"2‘¡±ÁðBRbrÑá#‚’¢²3S CñÿÄ   ÿÄ !    !1QAa‘2ÿÚ   ? 5˜Z¯V¦cø)›t/? z¨±>Õ5€¶‹Á¤·¼z¼Ü¬+ñ®v¤¨_ˆR­BFn©—˜ý®ç̝P8gýt·ÉSTŦˆìät?þé¼íìN/Þa)ì–í6ô… Ï¿øÃj´¿KÇü]ÿ ªô¹-eKànëÕHTx}ýSÜ›ÿ ”7Ø×&µ<¦  ¥ÑO¶[Ù¯ä¨ÞÃÿ PZ-¬;#õ|•oaÿ ©CìÞz3˜öː/¤­ñTûIØ}š^ mÓ%ªxˆ¥ÉŸu=Z+ISe¿45™¼u;ú&WØ÷€æßQ™®{|íx*TC“#ZŠìZ§²‹ 6pv…³¿¡äª*áZÐ%ÒOáˆo"x«OHk w±æ+¬V(kMúŸ5Vö«$ ÁrÏbàb57/luR ¸ÑÛj Òµì`Мq­û žICÀÊ•©4€Âcà¨Ï€O´<èÐ:›ù(Ë^L8þ‘ÍÌ#¸Ð_Ì©ÙK(Öz 4¬û+¸;ü’V’84‘¬ÃŽ:[â‡ÔÌáõp¢~§ªlæ£ö{®G>J¼"°‡7¯ÆÉèßû ‹É‹§ÁòÃýâßî ^ƾÙõ‹×óH#«LP½ïX=xÑÍ$|W?•~• îëÔ©ª‹ {ÝT…Kÿ ”hûâá)J*ö˜–ÔU;iÇ€/ ÆþjóZ\ýwØ=Ìm ºèËL9 ýèÆð/¨’¥öo=nË.%Îì ŽÕ¯È|{Oj²ƒE6e/ßdÄõ²Ìâ1O®ò×TsəԸhOMýíMˆ¿¼H˜l²,7Â¥#MF/Úf°Ö½± ¸–dr‹NýÊ íjqx{œÉ ä-È ¦ øÄër¨q°ð †nцýÑÄÆ’mä…n<0È™;ÁÝá¯ÁZƒ7FÀmì­ É&9ˆîéi¶ùN§Y• ÃZãAâ?•‡©‰ , ó¾IŸŠc1 4â&y­&pŠ­6;M À 0¹qç»p.á …ŸÅáK@%6·y6ƒ‰3?”úºŽ‰éX5ªPT §µ!=Mž«Ú½‹ÅgÂSâÉaþÓoö–¯ÁÔìR>5éÿ üs¶ÆUcÌ kÇR ]ÿ ù¬¼«VŽ;Â|‡~¢¦”ÏŰæ {L™Õ°Óv¹ò¸írޡעCÃ!íVÕ {¶»sŒNPg/ "uÕbkm²“$ďå¿é¹§°½æz¯6 †s¿!s–wÚÝ“™Œ °.ûj>·+™Òa…©Œ&rÝÎtÛë긪Ît’LAVp%c Úý[ÄzJ¾ÇàXXç@˜ó<êL]·T˜¾¥1Ó©V‡g´æ½¦Ý@¹óø!_@´ÞâSÁ —S3™•& ]@JHÚý©ZŽ €×æÔr»Áf!‡yÞ4Mv*èÓã_{‘åóUuљØ«Oïé*®EvÑ Œ÷‡U \"㪒ÍK+À 4“M¡ï:0¥5í!'<@î´”>Ç»&Z–ïCCV˜Ì5Šo&îhè.žû |ÓK©h$s6KìŒëã)¹hI¦GïOåóI;ììü#É$Š0…Ææ¥TØ.5­¾gn´ “ÂÖ\:hœ89G)J@„}œ:’Ò{/Š"¦_Æ×7Æ3VÇŠÊa]ÚŒÙ€Ä–=®uÁßâACZƒ§§£ Qnâ:«,×{tyø¬iÛcœÜÄ€H½ÄÍCk´÷šß .W'b¤Íåh]÷€=,Žv×cÚEÚHXJX¶îo¨FÒtèöŸ>ªª6[J®Fµ£sGÁeqõfe\íjÒÐïÄÐGˆe1Ø‹.Ø”‘Ëuø Y­ˆÜ ŽG|zùªüMpDnQWÄ”%JŠ™)â*p@Örš«ÕT2Ð%ˆG#ª„ ·¤!°ŸOTÂT¸aÚ%4&h™LµšØüÐ.F¿²ÐÞ_Ç‚¾ÅÃaÜ÷09Æ q€öy˜v‡85õN÷]¬äѼóS{°_MެúÔ#°Ç¸0åÞè2ëôPcvÆw9®ií1Ä8F™˜à‰´+‰Ik1òÝ7“Ñ×ÒsÝ\x‚h`ÞÑ`ó"|µEcý£n˜h`}GÞ !±ù²Ápü²ß6 0ïi󜵩SÈÇ7˜-ÕURO˜¦´f$ªž-Í6(œ}<„ éc øs]ŽŽ„*—¾ ìdŽ„)méª\¿êÎIg¾ØÞ~I#C/¼¼´EÁÈŽi8“©õådô·>euä ƒ'Ê×लR1ÉJE1ÐAát`t;ÇР%Ý<‡¥„ÍÆ`×Oyó)õiI€ñQaŸ4Ûù\áàaÃÔ¹HÃu¹*k€¦<„e S‡&õÏ B!ŽhüÞ`yj}mªf×\¿ Ç~æ­9‡û\՞Ǖg²1Žû5V7 !àöšm° c`ܬøÇìµÒ'P"?…´Ö,"§^•õލsÔ)6˜sæéÍR¼ ò|Sl”‹7 nPW Gòú÷½§O¯‡„l¡kSÞŒr½PÊ@æ¢pŽ-mÿ #Ÿ˜Àº¶Áä¦;ïÔæ$1££`“Õ>„—·ž)ßð³ñ#Ï Ô$¶œ‰ÊE‹À;÷º ¯«P:Ñ”8–IÊtpÞ3ª“>ê“þës4ò2OÏÕ­±zô†Õ§‰.÷ä¸;¿˜“'œ›žª}«Œ{ª±Ì 9ÔóÞÕ‡0 $íWV3Üì¬ —@kÝ4@¿r¼±½¬™›?øØæ´'Áé®CË3-g$˜ö‡×auÚi´Žp/êÛ æF›Ú2v‹ã¿¿,nB1̨ƃqÞa5͝@&Æû“él÷ \C²½UÍc ¯k×¢U ÖéQå™—-r wô ÞÏ<Ò=&=ÿ Ôê Òêˈt,i—;LîÜ á¸*ÚÃ1$êL•LÍ <É)ýÐà’ ;F™{ƒ™˜€&'}‚ãÄK`¡ÞT@I;®žZóè‚s’7®°›+§O­Åq©é»²9<Ô J ¼9O’HL»Ùïì¸rk¼Ž_ý‘TŸu[²ßÚŒ·ü÷B%¯E ŸÔX5êO´ Ç•€’I0 ÉJX` ñ¹õ%;µŸD‘«´€àwÒ™U ûئžÖö\×®×´8 ½‡ºÐÆÓ§?Àkmœ=;d5*@-ì0F Rªýš[Ü6âö̃ڸr*KA9· u*µæ£?U¸Âêí†8@¦X4 e-ò„0s{ HâUpU?¼mñRa°®a%Ð'tÉ×’\¾ÊÉ]t›h>·(Ë@R¼¡Ãt h}’O÷au<+nT…Ö…MӐ??Óe95 q>í/;&JSû °¯ÊéÞ øƒ*Ã2½Ài&:nôUl=¾¿5eˆ3”ñc|Ú2V”>„»&eE;«ÚäC p¢Û úy 9š[ŒÌx¼擼A&DåÒ¯ˆ¤ÀÌ;"˜ ÏQä¸åhÊ}Ûq«Û0WžÒ|»€ø®öCm5•\ÇÀ§Pe3£]0ÃàLDÉ‰1øªxjgwT‚÷¿LΨK‹›ùs—xˆÜ±µ kæ¸f‰‰ÜGk/LÛØ6d9ò¶ùA{ƒA3š/¬D¬khÓk‰`˜"㯒r¿±Óã jx‡°e}<Ñø\3y:'À•/h½Í€Ç4~g ?Û(¼]v‘ªlKÎâ~?O‚W%{Ì:“'©úNq¾›úo(X’¥¯ˆ nFê{Ç€ü?º'ë ø‹ì Þ09ŒÌç9Æ —ËC`j@ÓÄ(+a‹un¸#ÂꟋ{K`‘ÑÍÍ'à´»/Û,KW;Þ4²þð ï Nm|~fGÏ(…³Ã)«1ö­Õ ¥‡¨©ƒÃ™ü-s=à=U66Ï«Ýc蓦W¹íž®›nÔ%êÇìŒ<#Ü×84ån®Ð ÒåOC` ñânÑs‡¢ç 1õ%Îhì½Ã½® e:ݼUZo™`  ÅZŸŒÊ«ê1ÏÄo$q¹Þ€©ˆhÐÉä¯ñ[!…Ú˜àJ:x2$Íß&PåT£6ç— ‡Í*4Ýšçjÿ ‰É nófÐ ó(L5C•åÆ\rMÒ@ò }y-W}™üýVù—ú¢=Ù”c®‘< M ž ´Phr ¦©TD ‘ù.$´÷O‡‘V2Æò.=IUŒ=ž‡â¬i™aþÓåÙ?òUø'ØÖ•.~* šTŒ!•-×áºTâ®ä#õü'´ eýlYÅÓeÕKÂrT"CÚ@u!Óxƒ{š3€}1¿(r}%«nËamjÑ%ÑNEò v ˜à  σöK³,*º.àzù¨™Ó ÚçâU¦*¿ 9{%Ö¹ njûdaXöb) kÛÆ±ûÓ\°M7ˆÂ=û›ç¿Ã‚­V»Cg–8ÙêE- j)k$º`Ã-ùEýeBÆÇ]c¡°ñty&Òd0nõ'¡W+ƒ*|–øµFa\GQªEAÔp5\Ǽ·¼Ç8·õ -â§Ú[ ‡ uZeÖ 3}×d'+¹:ð+K†Û®s!Ï$úe€<Û”x)1»a­¡LC]¸µík…ÚàA»AYº{†ªS[¦5HÒ7ù --,ísòDØ€èk ÞÀîÜ ò@â( ËNˆë›4ô½•/¦o‡€Û7 ê•ÆêòðÜy'Án½µ á˜ݦ ndeo…[ì¶Ê,¥R³Ä=À±—–ß;£™´ñSâ*g§”ïaið‘Jå~™ÓÞ ß³Õ¢»8x埒²52>AÊb&-÷\7´éÄù€T˜,w;3{ï˜k…à¹ÄqÀ«œ{€\ ˆ¾[´¨јr &Úé„Ívˆ±8†¿]|¬ņ4I×pÞS1ÈÖz‰#Ìv‡G!YNògñ:màTz¢Ý1ô©^O=~ë|5Bã™ç•¼µõ•bÆ@úÕS¬ÈŒ#¬zünrŸ û” Z²•èðV"ÁHÚý©wÝ €7¼Ìu1hÑa3Éä û f$o¿É ™Ú›ÝçnpÒ3äÌ3†Í§,Äï]$‰/pê †«À¼¸e9­Æê_C]žƒ·ý·frÁN«, E=›Çq -‰öŒ:aÏ¿±í&£Í:-} 84‘ÿ eƒQÑeëSsuiA ³g㟥ú£?ÿ ʼn*”“÷aühe:ÊWa@ÒÞk±eØ] F Ô—r.åä˜ @ö¥ªZoÐýYL·¥S²G/‡ñ <~*ZÆ´è>JlòàÛÆ½ÿ 窘ìGN¢:I®KšJp/`íIÁÀõ#Ä-€ö­šµŒoF4|ÆQØÆ@Ì|£Ô…¢À{9˜è½Üó›€ôYÒÎYsið;ís¤€à²ˆ‚4qÉVŒI$ ‰"° æµ8cXGjœˏ¡Aâý•ËÜ¢ûï e·çLx']á"oÅÎê3¯Ç—¹”ó0nå‚âg{Œñ> S´˜îè°g238‚ãköÝfÚd´6Ò€;ò÷±¢™¼›º ¢Æ'¥Ðx'e¬ç ]bÈÆV¢ó‹kýBO ðÊâ$Ÿ!×T 3Mýמ žìٍàÌü‘8÷€àæØ8æ©6‰©L´«…oãpð„~Çk‰!ñ;‹”ÛžÍ àž±z Ÿôû øŸÝužÏ;ÿ #|u6™Þ¬ÚˆÐõA4¶â|ôl|Ê2ŽÇ¤ÝÅÇY.<#Aí.k§hóF‚”Y; M½Ö4hŸ4&›­¿tès´%FìL¥£Ãk‰ÇT¤haÁ¤ÚxfÉ`ÑìË›>i 3t‚:,–+^÷´–{Û–Nxi"x‘Ûg î¨>¥Õ܁ùZH,2Û“:8xÊ¢Çí9.É-Ìâã-=çjwµS˜dütžçwýGòú®®ûº_ˆýx$–¡ãøO EÚÛÏ÷R„×w+3£Á£öUMyR²¹âŒ°š›¸Ñãò9§Ó_Dl+Ùßc›úšGÅÌc†Ž!Ko=¶.‘Îÿ c²(2®V mª.ÿ ¹B›¹å ù„öŸSV>™ü¯$y:G¢Z×àøúdî¹û­·ýÇ´:•c LÍõi_‹ö+ÎæGÊè>OŠ•äž´§Þ{X}¨1ÚTc›»Qþ•êô°t¿OP?eæ~É{5]•ÙR£r5†nZ\ã@ &îJõ ¾àC°þV>fé¥/ü5ñÊIº_é5 ;e­h<@ Ä&æÃëE%;X,ÒãÆÞ`Oò¦kŸm#˜!ÀyÄ¢| óLšò¥Ä` ¶R=|ÈCâh5ò3DˆïF†ðÒ#ÅìÛœ?¸yhBãœí ZxßÎÄhºRK„`Þödvײ™ÀÈÑÒgŒuY w³%†ƒÓzõ ÖÏp‚dH®¦A´ù§»ÓÇMæ~)ˆð‡û:ù&Ä •vGD´À n ݇¼Ö8Fö óáà£~Ë¥x`oK|Ä?fxiØü%pìR>éò+Û±éÎ>núlFŤ'tq8LZÏvÃ?„¡ß±È⽆¯³íü@x|PöUäèØã¡ð‚ŒAìÏ"vÍwóŸÍ{ ý0.z È•Ö{,N¡£¡ŸKÕÙž>Ýœþ ÍÀ°<×EA!Å‚D™IúOÍ¡>ôG}Â` ÍßkÜL™Ž Þð™ {IøF²¹òQ3&!ÃÂÞz.d&Ï-sH¸,Ôõ˜ŽP€ 77ˆÝ¼ÊëÜw =cÕ Ú,ØÐ5ÎYÐ)ì´öœgŒ[¤ßv㙑8心>h]§µháYš£²ºÑ.{Ï7Sð•?´~×SÃKýJÛ˜ ™Íäiúu<µX¶1õ^kâçIÑ£sZ4h>j*ÔšD:4­¿_ ÷¸ Õxæÿ ¸?Mù _•­ÊÐ ä ÷ý ÑwL œ­ïnTkÛUÍN©ë:¦fV ¶ÜÔÜMªÅâA½–¿R×TXš-%iTÊT•‡Ù‚JôϐZxWÑè‰f‰òG º ×Õû2aZ7OU3[“×AT–ÞŒ…-‘¤”Ì ì&(ˆ¿­•ƒkï’:ðY¦W‘ Å)“†‘˜³Åtcø˜ñTÂwÚÇ4|üLÇªí–v- qˆèU qPE.†â‘˜µ Æ,ÐÅs]8¾„oúÑ i>ÜxxÈó)ƒ ´æÁâØ$À‰vžŸf$Ž |ãw;ÀÁIJ»b` {¦Ó¤Ú$©YÀ‘n@Óïž«9J¼êG m¤ ܯ¹ÌW4€ÐÒÅÛ‡#褕Ÿn-?í|с¥÷Ú¹¬'´ÞÜ9ÓK `hê£SÄSà?7—Wí_´…óB›»:=Ãïq`<8ñÓŒÑlú2d¬ê³£hÖ[l|$vÝro~'R®‰§°ñmY ͧäP |PUª¹·:3Œ[Û{Xÿ ºâ@‚W–Äé u‚ ¯´*=íή.pûÒdt @G‰¬ s¸ ëÉücr ÞæÑ¨Ê@>¤¢Ö±. Þ'¯°ÌME[YéïĵÂCå½ Ué©Áû'Ê9%eÔðNU”ë‘ÌsD3/®+UI˜9h.WC”빓$#:pz:YÓ ¿xž* ³$Í +$kñAŠ‹†¢ Uê>¸)_š¬÷©ßAÂÔb9ÇU ¯¾á•9¯ÏÏ÷O÷¼¼Fähal1‰3Ì[Ïr•´UCksNÐ] R‘¸¥H+§Šé†c©vÖÞ0iÓ76s†î!§=ß ¼~Ô'°Ãmäoäš³ªøi1úÉ)³yV8 CLÄØÁ‘WYïi€H6ÖÑiámø^ÈY´°Ñ7¥Û*—Ñ©L«Qƒï—Ùrÿ ›£Ð*š¸ˆL©ˆ$ˆ ÷¾D§9È®«qbqC)–ˆïv´çñsÑVT­Ø, <àïºÀO«Jý·õ àfPìð .wFšir´þ’2_Y *Æ€x\« ì€9š@ Ž|F⇥ˆkZ@hÖÄ0t¿-<“‹qµ¾*ZL¤Ú)&BJpÓF5=$„at*Zš$’ÑtdûÝRI1 2މ$€$I$#‰SÞ’Hë¬ï;Á$¡t$’`<(ñÇt)$‡Ð.Êf¢X’Kt=Éé$‚ˆªè¢oÝëòI%Rgcª÷ŠyI%¡‰ÿ !ñ)´õ $¤ Ô’IIGÿÙ" Vim indent file " Language: Julia " Maintainer: Carlo Baldassi " Homepage: https://github.com/JuliaEditorSupport/julia-vim " Last Change: 2022 Jun 14 " Notes: originally based on Bram Molenaar's indent file for vim " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal autoindent setlocal indentexpr=GetJuliaIndent() setlocal indentkeys+==end,=else,=catch,=finally,),],} setlocal indentkeys-=0# setlocal indentkeys-=: setlocal indentkeys-=0{ setlocal indentkeys-=0} setlocal nosmartindent " Only define the function once. if exists("*GetJuliaIndent") finish endif let s:skipPatternsBasic = '\' let s:skipPatterns = '\' function JuliaMatch(lnum, str, regex, st, ...) let s = a:st let e = a:0 > 0 ? a:1 : -1 let basic_skip = a:0 > 1 ? a:2 : 'all' let skip = basic_skip ==# 'basic' ? s:skipPatternsBasic : s:skipPatterns while 1 let f = match(a:str, '\C' . a:regex, s) if e >= 0 && f >= e return -1 endif if f >= 0 let attr = synIDattr(synID(a:lnum,f+1,1),"name") let attrT = synIDattr(synID(a:lnum,f+1,0),"name") if attr =~# skip || attrT =~# skip let s = f+1 continue endif endif break endwhile return f endfunction function GetJuliaNestingStruct(lnum, ...) " Auxiliary function to inspect the block structure of a line let line = getline(a:lnum) let s = a:0 > 0 ? a:1 : 0 let e = a:0 > 1 ? a:2 : -1 let blocks_stack = [] let num_closed_blocks = 0 while 1 let fb = JuliaMatch(a:lnum, line, '\<\%(if\|else\%(if\)\?\|while\|for\|try\|catch\|finally\|\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@', s, e) let fe = JuliaMatch(a:lnum, line, '\', s, e) if fb < 0 && fe < 0 " No blocks found break end if fb >= 0 && (fb < fe || fe < 0) " The first occurrence is an opening block keyword " Note: some keywords (elseif,else,catch,finally) are both " closing blocks and opening new ones let i = JuliaMatch(a:lnum, line, '\', s) if i >= 0 && i == fb let s = i+1 call add(blocks_stack, 'if') continue endif let i = JuliaMatch(a:lnum, line, '\', s) if i >= 0 && i == fb let s = i+1 if len(blocks_stack) > 0 && blocks_stack[-1] == 'if' let blocks_stack[-1] = 'elseif' elseif (len(blocks_stack) > 0 && blocks_stack[-1] != 'elseif') || len(blocks_stack) == 0 call add(blocks_stack, 'elseif') let num_closed_blocks += 1 endif continue endif let i = JuliaMatch(a:lnum, line, '\', s) if i >= 0 && i == fb let s = i+1 if len(blocks_stack) > 0 && blocks_stack[-1] =~# '\<\%(else\)\=if\>' let blocks_stack[-1] = 'else' else call add(blocks_stack, 'else') let num_closed_blocks += 1 endif continue endif let i = JuliaMatch(a:lnum, line, '\', s) if i >= 0 && i == fb let s = i+1 call add(blocks_stack, 'try') continue endif let i = JuliaMatch(a:lnum, line, '\', s) if i >= 0 && i == fb let s = i+1 if len(blocks_stack) > 0 && blocks_stack[-1] == 'try' let blocks_stack[-1] = 'catch' else call add(blocks_stack, 'catch') let num_closed_blocks += 1 endif continue endif let i = JuliaMatch(a:lnum, line, '\', s) if i >= 0 && i == fb let s = i+1 if len(blocks_stack) > 0 && (blocks_stack[-1] == 'try' || blocks_stack[-1] == 'catch') let blocks_stack[-1] = 'finally' else call add(blocks_stack, 'finally') let num_closed_blocks += 1 endif continue endif let i = JuliaMatch(a:lnum, line, '\<\%(bare\)\?module\>', s) if i >= 0 && i == fb let s = i+1 if i == 0 call add(blocks_stack, 'col1module') else call add(blocks_stack, 'other') endif continue endif let i = JuliaMatch(a:lnum, line, '\<\%(while\|for\|function\|macro\|begin\|\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\|let\|quote\|do\)\>', s) if i >= 0 && i == fb if match(line, '\C\<\%(mutable\|abstract\|primitive\)', i) != -1 let s = i+11 else let s = i+1 endif call add(blocks_stack, 'other') continue endif " Note: it should be impossible to get here break else " The first occurrence is an 'end' let s = fe+1 if len(blocks_stack) == 0 let num_closed_blocks += 1 else call remove(blocks_stack, -1) endif continue endif " Note: it should be impossible to get here break endwhile let num_open_blocks = len(blocks_stack) - count(blocks_stack, 'col1module') return [num_open_blocks, num_closed_blocks] endfunction function GetJuliaNestingBrackets(lnum, c) " Auxiliary function to inspect the brackets structure of a line let line = getline(a:lnum)[0 : (a:c - 1)] let s = 0 let brackets_stack = [] let last_closed_bracket = -1 while 1 let fb = JuliaMatch(a:lnum, line, '[([{]', s) let fe = JuliaMatch(a:lnum, line, '[])}]', s) if fb < 0 && fe < 0 " No brackets found break end if fb >= 0 && (fb < fe || fe < 0) " The first occurrence is an opening bracket let i = JuliaMatch(a:lnum, line, '(', s) if i >= 0 && i == fb let s = i+1 call add(brackets_stack, ['par',i]) continue endif let i = JuliaMatch(a:lnum, line, '\[', s) if i >= 0 && i == fb let s = i+1 call add(brackets_stack, ['sqbra',i]) continue endif let i = JuliaMatch(a:lnum, line, '{', s) if i >= 0 && i == fb let s = i+1 call add(brackets_stack, ['curbra',i]) continue endif " Note: it should be impossible to get here break else " The first occurrence is a closing bracket let i = JuliaMatch(a:lnum, line, ')', s) if i >= 0 && i == fe let s = i+1 if len(brackets_stack) > 0 && brackets_stack[-1][0] == 'par' call remove(brackets_stack, -1) else let last_closed_bracket = i + 1 endif continue endif let i = JuliaMatch(a:lnum, line, ']', s) if i >= 0 && i == fe let s = i+1 if len(brackets_stack) > 0 && brackets_stack[-1][0] == 'sqbra' call remove(brackets_stack, -1) else let last_closed_bracket = i + 1 endif continue endif let i = JuliaMatch(a:lnum, line, '}', s) if i >= 0 && i == fe let s = i+1 if len(brackets_stack) > 0 && brackets_stack[-1][0] == 'curbra' call remove(brackets_stack, -1) else let last_closed_bracket = i + 1 endif continue endif " Note: it should be impossible to get here break endif " Note: it should be impossible to get here break endwhile let first_open_bracket = -1 let last_open_bracket = -1 let infuncargs = 0 if len(brackets_stack) > 0 let first_open_bracket = brackets_stack[0][1] let last_open_bracket = brackets_stack[-1][1] if brackets_stack[-1][0] == 'par' && IsFunctionArgPar(a:lnum, last_open_bracket+1) let infuncargs = 1 endif endif return [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs] endfunction let s:bracketBlocks = '\' function IsInBrackets(lnum, c) let stack = map(synstack(a:lnum, a:c), 'synIDattr(v:val, "name")') call filter(stack, 'v:val =~# s:bracketBlocks') return len(stack) > 0 endfunction function IsInDocString(lnum) let stack = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")') call filter(stack, 'v:val =~# "\\"') return len(stack) > 0 endfunction function IsInContinuationImportLine(lnum) let stack = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")') call filter(stack, 'v:val =~# "\\"') if len(stack) == 0 return 0 endif return JuliaMatch(a:lnum, getline(a:lnum), '\<\%(import\|using\|export\)\>', indent(a:lnum)) == -1 endfunction function IsFunctionArgPar(lnum, c) if a:c == 0 return 0 endif let stack = map(synstack(a:lnum, a:c-1), 'synIDattr(v:val, "name")') return len(stack) >= 2 && stack[-2] ==# 'juliaFunctionDef' endfunction function JumpToMatch(lnum, last_closed_bracket) " we use the % command to skip back (tries to ues matchit if possible, " otherwise resorts to vim's default, which is buggy but better than " nothing) call cursor(a:lnum, a:last_closed_bracket) let percmap = maparg("%", "n") if exists("g:loaded_matchit") && percmap =~# 'Match\%(it\|_wrapper\)' normal % else normal! % end endfunction " Auxiliary function to find a line which does not start in the middle of a " multiline bracketed expression, to be used as reference for block " indentation. function LastBlockIndent(lnum) let lnum = a:lnum let ind = 0 while lnum > 0 let ind = indent(lnum) if ind == 0 return [lnum, 0] endif if !IsInBrackets(lnum, 1) break endif let lnum = prevnonblank(lnum - 1) endwhile return [max([lnum,1]), ind] endfunction function GetJuliaIndent() " Do not alter doctrings indentation if IsInDocString(v:lnum) return -1 endif " Find a non-blank line above the current line. let lnum = prevnonblank(v:lnum - 1) " At the start of the file use zero indent. if lnum == 0 return 0 endif let ind = -1 let st = -1 let lim = -1 " Multiline bracketed expressions take precedence let align_brackets = get(g:, "julia_indent_align_brackets", 1) let align_funcargs = get(g:, "julia_indent_align_funcargs", 0) let c = len(getline(lnum)) + 1 while IsInBrackets(lnum, c) let [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs] = GetJuliaNestingBrackets(lnum, c) " First scenario: the previous line has a hanging open bracket: " set the indentation to match the opening bracket (plus an extra space) " unless we're in a function arguments list or alignment is disabled, in " which case we just add an extra indent if last_open_bracket != -1 if (!infuncargs && align_brackets) || (infuncargs && align_funcargs) let st = last_open_bracket let ind = virtcol([lnum, st + 1]) else let ind = indent(lnum) + shiftwidth() endif " Second scenario: some multiline bracketed expression was closed in the " previous line. But since we know we are still in a bracketed expression, " we need to find the line where the bracket was opened elseif last_closed_bracket != -1 call JumpToMatch(lnum, last_closed_bracket) if line(".") == lnum " something wrong here, give up let ind = indent(lnum) else let lnum = line(".") let c = col(".") - 1 if c == 0 " uhm, give up let ind = 0 else " we skipped a bracket set, keep searching for an opening bracket let lim = c continue endif endif " Third scenario: nothing special: keep the indentation else let ind = indent(lnum) endif " Does the current line start with a closing bracket? Then depending on " the situation we align it with the opening one, or we let the rest of " the code figure it out (the case in which we're closing a function " argument list is special-cased) if JuliaMatch(v:lnum, getline(v:lnum), '[])}]', indent(v:lnum)) == indent(v:lnum) && ind > 0 if !align_brackets && !align_funcargs call JumpToMatch(v:lnum, indent(v:lnum)) return indent(line(".")) elseif (align_brackets && getline(v:lnum)[indent(v:lnum)] != ')') || align_funcargs return ind - 1 else " must be a ')' and align_brackets==1 and align_funcargs==0 call JumpToMatch(v:lnum, indent(v:lnum)) if IsFunctionArgPar(line("."), col(".")) let ind = -1 else return ind - 1 endif endif endif break endwhile if ind == -1 " We are not in a multiline bracketed expression. Thus we look for a " previous line to use as a reference let [lnum,ind] = LastBlockIndent(lnum) let c = len(getline(lnum)) + 1 if IsInBrackets(lnum, c) let [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs] = GetJuliaNestingBrackets(lnum, c) let lim = first_open_bracket endif end " Analyse the reference line let [num_open_blocks, num_closed_blocks] = GetJuliaNestingStruct(lnum, st, lim) " Increase indentation for each newly opened block in the reference line let ind += shiftwidth() * num_open_blocks " Analyse the current line let [num_open_blocks, num_closed_blocks] = GetJuliaNestingStruct(v:lnum) " Decrease indentation for each closed block in the current line let ind -= shiftwidth() * num_closed_blocks " Additional special case: multiline import/using/export statements let prevline = getline(lnum) " Are we in a multiline import/using/export statement, right below the " opening line? if IsInContinuationImportLine(v:lnum) && !IsInContinuationImportLine(lnum) if get(g:, 'julia_indent_align_import', 1) " if the opening line has a colon followed by non-comments, use it as " reference point let cind = JuliaMatch(lnum, prevline, ':', indent(lnum), lim) if cind >= 0 let nonwhiteind = JuliaMatch(lnum, prevline, '\S', cind+1, -1, 'basic') if nonwhiteind >= 0 " return match(prevline, '\S', cind+1) " a bit overkill... return cind + 2 endif else " if the opening line is not a naked import/using/export statement, use " it as reference let iind = JuliaMatch(lnum, prevline, '\', indent(lnum), lim) if iind >= 0 " assuming whitespace after using... so no `using(XYZ)` please! let nonwhiteind = JuliaMatch(lnum, prevline, '\S', iind+6, -1, 'basic') if nonwhiteind >= 0 return match(prevline, '\S', iind+6) endif endif endif endif let ind += shiftwidth() " Or did we just close a multiline import/using/export statement? elseif !IsInContinuationImportLine(v:lnum) && IsInContinuationImportLine(lnum) " find the starting line of the statement let ilnum = 0 for iln in range(lnum-1, 1, -1) if !IsInContinuationImportLine(iln) let ilnum = iln break endif endfor if ilnum == 0 " something went horribly wrong, give up let ind = indent(lnum) endif let ind = indent(ilnum) endif return ind endfunction