mirror of
https://github.com/urbit/shrub.git
synced 2024-12-12 10:29:01 +03:00
Recover a BUNCH of old stuff from a stash.
This commit is contained in:
parent
e6f584023d
commit
bd4eff0fbb
@ -206,7 +206,6 @@
|
||||
++ init :: initialize
|
||||
|= gyl=(list gill)
|
||||
^+ +>
|
||||
~& [%as-init ram gyl]
|
||||
=. moz :_(moz [hen %pass ~ %g %show [our [ram ~]] our ~])
|
||||
|- ^+ +>.^$
|
||||
?~ gyl +>.^$
|
||||
|
@ -362,21 +362,34 @@
|
||||
%txt $(fec [%tan [%leaf p.fec]~])
|
||||
==
|
||||
::
|
||||
++ ta-dog :: correct position
|
||||
|= ted=console-edit
|
||||
?. ?=(%set -.ted) +>
|
||||
+>(pos.inp (lent buf.say.inp))
|
||||
++ ta-dog :: change cursor
|
||||
|= ted=console-edit
|
||||
%_ +>
|
||||
pos.inp
|
||||
=+ len=(lent buf.say.inp)
|
||||
%+ min len
|
||||
|- ^- @ud
|
||||
?- -.ted
|
||||
%del ?:((gth pos.inp p.ted) (dec pos.inp) pos.inp)
|
||||
%ins ?:((lte pos.inp p.ted) +(pos.inp) pos.inp)
|
||||
%mor |- ^- @ud
|
||||
?~ p.ted pos.inp
|
||||
$(p.ted t.p.ted, pos.inp ^$(ted i.p.ted))
|
||||
%nop pos.inp
|
||||
%set len
|
||||
==
|
||||
==
|
||||
::
|
||||
++ ta-got :: apply change
|
||||
|= cal=console-change
|
||||
=. +> (ta-dog:+>(say.inp abet:(~(receive cs say.inp) cal)) ted.cal)
|
||||
+>
|
||||
=^ ted say.inp (~(receive cs say.inp) cal)
|
||||
(ta-dog ted)
|
||||
::
|
||||
++ ta-hom :: local edit
|
||||
|= ted=console-edit
|
||||
^+ +>
|
||||
=. +> (ta-det ted)
|
||||
=. +> (ta-dog:+>(say.inp abet:(~(commit cs say.inp) ted)) ted)
|
||||
=. +> (ta-dog(say.inp (~(commit cs say.inp) ted)) ted)
|
||||
+>
|
||||
::
|
||||
++ ta-met :: meta key
|
||||
@ -460,8 +473,7 @@
|
||||
cap.pom
|
||||
`(list ,@)`:(welp "(reverse-i-search)'" str.u.ris "': ")
|
||||
==
|
||||
=- =. pos.inp (max pos.inp (lent q.vew))
|
||||
[(add pos.inp (lent p.vew)) (weld p.vew q.vew)]
|
||||
=- [(add pos.inp (lent p.vew)) (weld p.vew q.vew)]
|
||||
^= vew ^- (pair (list ,@c) (list ,@c))
|
||||
?: vis.pom [cap.pom buf.say.inp]
|
||||
:- ;: welp
|
||||
|
@ -129,8 +129,8 @@
|
||||
::
|
||||
++ commit :: local change
|
||||
|= ted=console-edit
|
||||
^+ +>
|
||||
(apply(own.ven +(own.ven)) ted)
|
||||
^- console-share
|
||||
abet:(apply(own.ven +(own.ven)) ted)
|
||||
::
|
||||
::::
|
||||
:: ++inverse: inverse of change in context.
|
||||
@ -157,40 +157,26 @@
|
||||
::
|
||||
++ transmit :: outgoing change
|
||||
|= ted=console-edit
|
||||
^- [console-change _+>]
|
||||
^- [console-change console-share]
|
||||
[[[his.ven own.ven] (sham buf) ted] (commit ted)]
|
||||
::
|
||||
++ realize :: naturalize event
|
||||
++ receive :: naturalize event
|
||||
|= console-change
|
||||
^- [console-edit _+>]
|
||||
^- [console-edit console-share]
|
||||
?> &(=(his.ler his.ven) (lte own.ler own.ven))
|
||||
?> &(=(his.ler his.ven) (lte own.ler own.ven))
|
||||
?> |(!=(own.ler own.ven) =(haw (sham buf)))
|
||||
=. leg (scag (sub own.ven own.ler) leg)
|
||||
[(transmute [%mor leg] ted) +>]
|
||||
=+ dat=(transmute [%mor leg] ted)
|
||||
[dat abet:(apply(his.ven +(his.ven)) dat)]
|
||||
::
|
||||
++ remit :: conditional accept
|
||||
|= [cal=console-change ask=$+((list ,@c) ?)]
|
||||
^- [(unit console-change) _+>]
|
||||
=+ old=+>
|
||||
=^ dat +>.$ (realize cal)
|
||||
=. +>.$ (apply(his.ven +(his.ven)) dat)
|
||||
^- [(unit console-change) console-share]
|
||||
=^ dat +>+<.$ (receive cal)
|
||||
?: (ask buf)
|
||||
[~ +>.$]
|
||||
=+ wad=(inverse dat)
|
||||
:: ~& [%remit-old buf.old]
|
||||
:: ~& [%remit-new buf]
|
||||
:: ~& [%remit ted/ted.cal]
|
||||
:: ~& [%remit dat/dat]
|
||||
:: ~& [%remit wad/wad]
|
||||
=^ lic +>.$ (transmit wad)
|
||||
:: ~& [%remit-end [lic buf]]
|
||||
[`lic +>.$]
|
||||
::
|
||||
++ receive :: accept change
|
||||
|= cal=console-change
|
||||
^+ +>
|
||||
=^ dat +> (realize cal)
|
||||
(apply(his.ven +(his.ven)) dat)
|
||||
[~ +>+<.$]
|
||||
=^ lic +>+<.$ (transmit (inverse dat))
|
||||
[`lic +>+<.$]
|
||||
--
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user