mirror of
https://github.com/urbit/shrub.git
synced 2024-12-14 01:08:54 +03:00
Merge branch 'test'
This commit is contained in:
commit
05fd1e5cbe
@ -763,27 +763,29 @@
|
|||||||
++ sh-sane-chat :: sanitize chatter
|
++ sh-sane-chat :: sanitize chatter
|
||||||
|= buf=(list ,@c)
|
|= buf=(list ,@c)
|
||||||
^- (list sole-edit)
|
^- (list sole-edit)
|
||||||
|
?~ buf ~
|
||||||
=+ [inx=0 sap=0 con=0]
|
=+ [inx=0 sap=0 con=0]
|
||||||
|^ run
|
|^ ^- (list sole-edit)
|
||||||
++ fix |=(cha=@ [%mor [%del inx] [%ins inx `@c`cha] ~])
|
?: =(i.buf (turf '•'))
|
||||||
++ run ^- (list sole-edit)
|
?. =(0 con) newline
|
||||||
?~ buf ~
|
[[%del inx] ?~(t.buf ~ $(buf t.buf))]
|
||||||
?: =(i.buf (turf '•'))
|
?: =(i.buf ' ')
|
||||||
?~ con [[%del inx] run(buf t.buf)]
|
?. =(64 con) advance(sap inx)
|
||||||
run(con 0, inx +(inx), buf t.buf)
|
[(fix (turf '•')) newline]
|
||||||
?: =(64 con)
|
?: =(64 con)
|
||||||
=+ dif=(sub inx sap)
|
=+ dif=(sub inx sap)
|
||||||
?: (lth dif 64)
|
?: (lth dif 64)
|
||||||
[(fix(inx sap) (turf '•')) run(con dif)]
|
[(fix(inx sap) (turf '•')) $(con dif)]
|
||||||
[[%ins inx (turf '•')] run(con 0, inx +(inx))]
|
[[%ins inx (turf '•')] $(con 0, inx +(inx))]
|
||||||
?: =(i.buf ' ')
|
?: |((lth i.buf 32) (gth i.buf 126))
|
||||||
run(sap inx, inx +(inx), con +(con), buf t.buf)
|
[(fix '?') advance]
|
||||||
=+ lit=run(inx +(inx), con +(con), buf t.buf)
|
?: &((gte i.buf 'A') (lte i.buf 'Z'))
|
||||||
?: |((lth i.buf 32) (gth i.buf 126))
|
[(fix (add 32 i.buf)) advance]
|
||||||
[(fix '?') lit]
|
advance
|
||||||
?: &((gte i.buf 'A') (lte i.buf 'Z'))
|
::
|
||||||
[(fix (add 32 i.buf)) lit]
|
++ advance ?~(t.buf ~ $(con +(con), inx +(inx), buf t.buf))
|
||||||
lit
|
++ newline ?~(t.buf ~ $(con 0, inx +(inx), buf t.buf))
|
||||||
|
++ fix |=(cha=@ [%mor [%del inx] [%ins inx `@c`cha] ~])
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
++ sh-sane :: sanitize input
|
++ sh-sane :: sanitize input
|
||||||
@ -1858,6 +1860,7 @@
|
|||||||
::
|
::
|
||||||
++ tr-tang ^- tang
|
++ tr-tang ^- tang
|
||||||
%+ welp tr-sep-tang
|
%+ welp tr-sep-tang
|
||||||
|
=. wen (sub wen (mod wen (div wen ~s0..0001))) :: round
|
||||||
=+ hed=leaf/"{(scow %uv sen)} at {(scow %da wen)}"
|
=+ hed=leaf/"{(scow %uv sen)} at {(scow %da wen)}"
|
||||||
=+ =< paz=(turn (~(tap by aud)) .)
|
=+ =< paz=(turn (~(tap by aud)) .)
|
||||||
|=([a=partner *] leaf/~(ta-full ta man a))
|
|=([a=partner *] leaf/~(ta-full ta man a))
|
||||||
|
@ -495,7 +495,7 @@
|
|||||||
?. liv
|
?. liv
|
||||||
?: (~(has in (deft-fish our)) gyl)
|
?: (~(has in (deft-fish our)) gyl)
|
||||||
(se-blit qit/~)
|
(se-blit qit/~)
|
||||||
(se-nuke gyl)
|
(se-nuke gyl)
|
||||||
..ta(fug (~(put by fug) gyl ``target`+<+))
|
..ta(fug (~(put by fug) gyl ``target`+<+))
|
||||||
::
|
::
|
||||||
++ ta-poke |=(a=pear +>(..ta (se-poke gyl a))) :: poke gyl
|
++ ta-poke |=(a=pear +>(..ta (se-poke gyl a))) :: poke gyl
|
||||||
@ -556,7 +556,7 @@
|
|||||||
(ta-act %clr ~)
|
(ta-act %clr ~)
|
||||||
:: .(+> (se-blit %bel ~))
|
:: .(+> (se-blit %bel ~))
|
||||||
=+ pre=(dec pos.inp)
|
=+ pre=(dec pos.inp)
|
||||||
(ta-hom(pos.inp pre) %del pre)
|
(ta-hom %del pre)
|
||||||
::
|
::
|
||||||
++ ta-ctl :: hear control
|
++ ta-ctl :: hear control
|
||||||
|= key=@ud
|
|= key=@ud
|
||||||
@ -596,13 +596,12 @@
|
|||||||
==
|
==
|
||||||
%u ?: =(0 pos.inp)
|
%u ?: =(0 pos.inp)
|
||||||
ta-bel
|
ta-bel
|
||||||
%- ta-hom(pos.inp 0, kil `(scag pos.inp buf.say.inp))
|
%- ta-hom(kil `(scag pos.inp buf.say.inp))
|
||||||
(ta-cut 0 pos.inp)
|
(ta-cut 0 pos.inp)
|
||||||
%v ta-bel
|
%v ta-bel
|
||||||
%x +>(+> se-anon)
|
%x +>(+> se-anon)
|
||||||
%y ?~ kil ta-bel
|
%y ?~ kil ta-bel
|
||||||
%- ta-hom(pos.inp (add pos.inp (lent u.kil)))
|
(ta-hom (ta-cat pos.inp u.kil))
|
||||||
(ta-cat pos.inp u.kil)
|
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ ta-cru :: hear crud
|
++ ta-cru :: hear crud
|
||||||
@ -653,7 +652,7 @@
|
|||||||
|- ^- @ud
|
|- ^- @ud
|
||||||
?- -.ted
|
?- -.ted
|
||||||
%del ?:((gth pos.inp p.ted) (dec pos.inp) pos.inp)
|
%del ?:((gth pos.inp p.ted) (dec pos.inp) pos.inp)
|
||||||
%ins ?:((lte pos.inp p.ted) +(pos.inp) pos.inp)
|
%ins ?:((gte pos.inp p.ted) +(pos.inp) pos.inp)
|
||||||
%mor |- ^- @ud
|
%mor |- ^- @ud
|
||||||
?~ p.ted pos.inp
|
?~ p.ted pos.inp
|
||||||
$(p.ted t.p.ted, pos.inp ^$(ted i.p.ted))
|
$(p.ted t.p.ted, pos.inp ^$(ted i.p.ted))
|
||||||
@ -743,7 +742,7 @@
|
|||||||
^+ +>
|
^+ +>
|
||||||
?^ ris
|
?^ ris
|
||||||
(ta-ser txt)
|
(ta-ser txt)
|
||||||
%- ta-hom(pos.inp (add (lent txt) pos.inp))
|
%- ta-hom
|
||||||
:- %mor
|
:- %mor
|
||||||
|- ^- (list sole-edit)
|
|- ^- (list sole-edit)
|
||||||
?~ txt ~
|
?~ txt ~
|
||||||
|
Loading…
Reference in New Issue
Block a user