mirror of
https://github.com/urbit/shrub.git
synced 2024-12-02 08:55:07 +03:00
Merge remote-tracking branches 'Fang/urbjs-isurl', 'ohaitch/stray-marks', 'eglaysher/fix-help', 'joemfb/prompt-sticky-master', 'joemfb/cork-safe' and 'joemfb/fry-nest'
This commit is contained in:
commit
e10dc26bea
@ -1,5 +1,5 @@
|
||||
:: Describe available comands: +help, +help %tree, +help %hood
|
||||
::
|
||||
::
|
||||
:::: /hoon/help/gen
|
||||
::
|
||||
/? 310
|
||||
@ -25,7 +25,7 @@
|
||||
{$hood ^} "|{(path-heps t.b)}"
|
||||
^ "+{(path-heps b)}" :: XX deal with :talk|foo
|
||||
==
|
||||
=/ c (to-wain a)
|
||||
=/ c (to-wain:format a)
|
||||
?~ c "~"
|
||||
?. =(':: ' (end 3 4 i.c))
|
||||
"<undocumented>"
|
||||
@ -35,9 +35,9 @@
|
||||
|= {len/@u pax/path}
|
||||
|= {nam/@t ark/arch} ^- (unit {@t path})
|
||||
?. (~(has by dir.ark) %hoon) ~
|
||||
%+ bind (file (welp pax /[nam]/hoon))
|
||||
%+ bind (file:space:userlib (welp pax /[nam]/hoon))
|
||||
|= a/* ^- {cord path}
|
||||
[;;(@t a) (welp (slag len pax) /[nam])]
|
||||
[;;(@t a) (welp (slag len pax) /[nam])]
|
||||
--
|
||||
::
|
||||
:- %say
|
||||
|
@ -302,7 +302,7 @@
|
||||
=+ wag=se-amor
|
||||
?~ wag +
|
||||
:: ~& [%se-anon inx+inx wag+wag nex+(mod +(inx) (lent se-amor))]
|
||||
+(inx (mod +(inx) (lent wag)))
|
||||
+(off 0, inx (mod +(inx) (lent wag)))
|
||||
::
|
||||
++ se-agon :: current gill
|
||||
^- (unit gill:gall)
|
||||
@ -401,10 +401,24 @@
|
||||
+>(mir lin)
|
||||
::
|
||||
++ se-just :: adjusted buffer
|
||||
|= lin/(pair @ud stub:dill)
|
||||
|= {pom/stub:dill lin/(pair @ud (list @c))}
|
||||
^+ +>
|
||||
=. off ?:((lth p.lin edg) 0 (sub p.lin edg))
|
||||
(se-show (sub p.lin off) (scag:klr edg (slag:klr off q.lin)))
|
||||
=/ pol (lent-char:klr pom)
|
||||
=/ end (sub edg pol)
|
||||
=/ pos (add pol p.lin)
|
||||
?: (gte (div (mul pol 100) edg) 35) :: old style (long prompt)
|
||||
=/ off ?:((lte p.lin end) 0 (sub p.lin end))
|
||||
%+ se-show
|
||||
(sub pos off)
|
||||
(swag:klr [off edg] (welp pom [*stye:dill q.lin]~))
|
||||
=. off ?: (gth p.lin (add end off))
|
||||
(sub p.lin end)
|
||||
?: (lth p.lin off)
|
||||
(min p.lin (dec off))
|
||||
off
|
||||
%+ se-show
|
||||
(sub pos off)
|
||||
(welp pom [*stye:dill (swag [off end] q.lin)]~)
|
||||
::
|
||||
++ se-view :: flush buffer
|
||||
^+ .
|
||||
@ -562,7 +576,7 @@
|
||||
$v ta-bel
|
||||
$w ?: =(0 pos.inp)
|
||||
ta-bel
|
||||
=+ sop=(ta-off %l %ace pos.inp)
|
||||
=+ sop=(ta-pos %l %ace pos.inp)
|
||||
(ta-kil %l [(sub pos.inp sop) sop])
|
||||
$x +>(..ta se-anon)
|
||||
$y ?: =(0 num.kil)
|
||||
@ -624,22 +638,27 @@
|
||||
==
|
||||
==
|
||||
::
|
||||
++ ta-off :: reset buffer offset
|
||||
|= ted/sole-edit
|
||||
=? off (any:edit ted |=(a/sole-edit ?=($set -.a))) 0
|
||||
+>
|
||||
::
|
||||
++ ta-got :: apply change
|
||||
|= cal/sole-change
|
||||
=^ ted say.inp (~(receive sole say.inp) cal)
|
||||
(ta-dog ted)
|
||||
(ta-dog:(ta-off ted.cal) ted)
|
||||
::
|
||||
++ ta-hom :: local edit
|
||||
|= ted/sole-edit
|
||||
^+ +>
|
||||
=. +> (ta-det ted)
|
||||
=. +> (ta-det:(ta-off ted) ted)
|
||||
(ta-dog(say.inp (~(commit sole say.inp) ted)) ted)
|
||||
::
|
||||
++ ta-jump :: buffer pos
|
||||
|= {dir/?($l $r) til/?($ace $edg $wrd) pos/@ud}
|
||||
^- @ud
|
||||
%- ?:(?=($l dir) sub add)
|
||||
[pos (ta-off dir til pos)]
|
||||
[pos (ta-pos dir til pos)]
|
||||
::
|
||||
++ ta-kil :: kill selection
|
||||
|= {dir/?($l $r) sel/{@ @}}
|
||||
@ -680,7 +699,7 @@
|
||||
::
|
||||
$bac ?: =(0 pos.inp) :: kill left-word
|
||||
ta-bel
|
||||
=+ sop=(ta-off %l %edg pos.inp)
|
||||
=+ sop=(ta-pos %l %edg pos.inp)
|
||||
(ta-kil %l [(sub pos.inp sop) sop])
|
||||
::
|
||||
$b ?: =(0 pos.inp) :: jump left-word
|
||||
@ -697,7 +716,7 @@
|
||||
::
|
||||
$d ?: =(pos.inp (lent buf.say.inp)) :: kill right-word
|
||||
ta-bel
|
||||
(ta-kil %r [pos.inp (ta-off %r %edg pos.inp)])
|
||||
(ta-kil %r [pos.inp (ta-pos %r %edg pos.inp)])
|
||||
::
|
||||
$f ?: =(pos.inp (lent buf.say.inp)) :: jump right-word
|
||||
ta-bel
|
||||
@ -714,7 +733,7 @@
|
||||
?: =(b c)
|
||||
ta-bel
|
||||
=+ next=[b (sub a b)]
|
||||
=+ prev=[c (ta-off %r %edg c)]
|
||||
=+ prev=[c (ta-pos %r %edg c)]
|
||||
%- ta-hom(pos.inp a)
|
||||
:~ %mor
|
||||
(rep:edit next (swag prev buf.say.inp))
|
||||
@ -726,7 +745,7 @@
|
||||
ta-bel
|
||||
=+ case=?:(?=($u key) cuss cass)
|
||||
=+ sop=(ta-jump %r %wrd pos.inp)
|
||||
=+ sel=[sop (ta-off %r %edg sop)]
|
||||
=+ sel=[sop (ta-pos %r %edg sop)]
|
||||
%- ta-hom
|
||||
%+ rep:edit sel
|
||||
^- (list @c) ^- (list @) :: XX unicode
|
||||
@ -769,7 +788,7 @@
|
||||
old.hit [buf.say.inp old.hit]
|
||||
==
|
||||
::
|
||||
++ ta-off :: buffer pos offset
|
||||
++ ta-pos :: buffer pos offset
|
||||
|= {dir/?($l $r) til/?($ace $edg $wrd) pos/@ud}
|
||||
^- @ud
|
||||
%- ?- til $ace ace:offset
|
||||
@ -826,11 +845,9 @@
|
||||
(ta-hom (cat:edit pos.inp txt))
|
||||
::
|
||||
++ ta-vew :: computed prompt
|
||||
^- (pair @ud stub:dill)
|
||||
^- {pom/stub:dill lin/(pair @ud (list @c))}
|
||||
=; vew/(pair (list @c) styx:dill)
|
||||
=+ lin=(make:klr q.vew)
|
||||
:_ (welp lin [*stye:dill p.vew]~)
|
||||
(add pos.inp (lent-char:klr lin))
|
||||
[(make:klr q.vew) pos.inp p.vew]
|
||||
?: vis.pom
|
||||
:- buf.say.inp :: default prompt
|
||||
?~ ris
|
||||
@ -870,6 +887,11 @@
|
||||
(cut pos num)
|
||||
(cat pos txt)
|
||||
==
|
||||
++ any :: matches?
|
||||
|= {a/sole-edit b/$-(sole-edit ?)}
|
||||
^- ?
|
||||
?. ?=($mor -.a) (b a)
|
||||
(lien p.a |=(c/sole-edit ^$(a c)))
|
||||
--
|
||||
++ offset :: calculate offsets
|
||||
|%
|
||||
@ -995,5 +1017,9 @@
|
||||
=+ n=(snag p.u.i b)
|
||||
:_ ~ :- p.n
|
||||
(^scag (sub (snag p.u.i c) (sub q.u.i a)) q.n)
|
||||
::
|
||||
++ swag :: swag stub, keep stye
|
||||
|= {{a/@ b/@} c/stub}
|
||||
(scag b (slag a c))
|
||||
--
|
||||
--
|
||||
|
@ -1,4 +1,4 @@
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
=, format
|
||||
=, html
|
||||
|=(hit/httr ~|(hit ?>(?=($2 (div p.hit 100)) (need (de-json q:(need r.hit))))))
|
||||
|
@ -26,8 +26,9 @@
|
||||
%+ cu malt
|
||||
%+ ci
|
||||
|= a/(map cord _(need *wit))
|
||||
=, unity
|
||||
^- (unit (list _[(wonk *fel) (need *wit)]))
|
||||
(zl (turn (~(tap by a)) (head-rush fel)))
|
||||
(drop-list (turn (~(tap by a)) (head-rush fel)))
|
||||
(om wit)
|
||||
::
|
||||
++ ke :: callbacks
|
||||
|
@ -3,7 +3,7 @@
|
||||
::
|
||||
/? 310
|
||||
/- talk
|
||||
/+ talk,map-to-json, old-zuse
|
||||
/+ talk, map-to-json, old-zuse
|
||||
::
|
||||
=, talk
|
||||
=, mimes:html
|
||||
@ -17,46 +17,37 @@
|
||||
++ noun (list telegram)
|
||||
++ mime |=(^mime (json (rash q.q apex:de-json)))
|
||||
++ json
|
||||
=> [jo ..telegram]
|
||||
=> [dejs talk old-zuse]
|
||||
|= a/json ^- (list telegram)
|
||||
=- (need ((ar (ot ship+(su fed:ag) thought+thot ~)) a))
|
||||
|%
|
||||
++ of
|
||||
|* a/(pole {@tas fist})
|
||||
|= b/json
|
||||
%. ((of:jo a) b)
|
||||
%- slog
|
||||
?+ b ~
|
||||
{$o *}
|
||||
%+ murn `(list {@tas fist})`a
|
||||
|= {c/term d/fist} ^- (unit tank)
|
||||
=+ (~(get by p.b) c)
|
||||
?~ - ~
|
||||
=+ (d u)
|
||||
?~ - (some >[c u]<)
|
||||
~
|
||||
==
|
||||
++ op :: parse keys of map
|
||||
|* {fel/rule wit/fist}
|
||||
%+ cu malt
|
||||
%+ ci
|
||||
|= a/(map cord _(need *wit))
|
||||
^- (unit (list _[(wonk *fel) (need *wit)]))
|
||||
(zl (turn (~(tap by a)) (head-rush fel)))
|
||||
(om wit)
|
||||
%. a
|
||||
|^ (ar (ot ship+(su fed:ag) thought+thot ~))
|
||||
:: ++ of
|
||||
:: |* a/(pole {@tas fist})
|
||||
:: |= b/json
|
||||
:: %. ((of:jo a) b)
|
||||
:: %- slog
|
||||
:: ?+ b ~
|
||||
:: {$o *}
|
||||
:: %+ murn `(list {@tas fist})`a
|
||||
:: |= {c/term d/fist} ^- (unit tank)
|
||||
:: =+ (~(get by p.b) c)
|
||||
:: ?~ - ~
|
||||
:: =+ (d u)
|
||||
:: ?~ - (some >[c u]<)
|
||||
:: ~
|
||||
:: ==
|
||||
::
|
||||
++ as :: array as set
|
||||
|* a/fist
|
||||
(cu ~(gas in *(set _(need *a))) (ar a))
|
||||
(cu ~(gas in *(set _*a)) (ar a))
|
||||
::
|
||||
++ ke :: callbacks
|
||||
|* {gar/* sef/_|.(fist)}
|
||||
|= jon/json
|
||||
^- (unit _gar)
|
||||
^+ gar
|
||||
=- ~! gar ~! (need -) -
|
||||
((sef) jon)
|
||||
::
|
||||
++ lake |*(a/_* $-(json (unit a)))
|
||||
++ head-rush
|
||||
|* a/rule
|
||||
|* {cord *}
|
||||
@ -65,17 +56,17 @@
|
||||
(some [u.nit +>->])
|
||||
::
|
||||
++ thot
|
||||
^- $-(json (unit thought))
|
||||
^- $-(json thought)
|
||||
%- ot :~
|
||||
serial+`$-(json (unit serial))`(ci (slat %uv) so)
|
||||
audience+`$-(json (unit audience))`audi
|
||||
statement+`$-(json (unit statement))`stam
|
||||
serial+`$-(json serial)`(ci (slat %uv) so)
|
||||
audience+`$-(json audience)`audi
|
||||
statement+`$-(json statement)`stam
|
||||
==
|
||||
::
|
||||
++ audi `$-(json (unit audience))`(op parn memb)
|
||||
++ audi `$-(json audience)`(op parn memb)
|
||||
++ auri (op parn (ci (soft presence) so))
|
||||
++ memb ^- $-(json (unit (pair envelope delivery)))
|
||||
(ot envelope+lope delivery+(ci (soft delivery) so) ~)
|
||||
++ memb ^- $-(json (pair envelope delivery))
|
||||
(ot envelope+lope delivery+(cu (hard delivery) so) ~)
|
||||
++ lope (ot visible+bo sender+(mu (su parn)) ~)
|
||||
::
|
||||
++ parn
|
||||
|
@ -5,6 +5,7 @@
|
||||
/- talk
|
||||
/+ twitter, httr-to-json, old-zuse
|
||||
=, old-zuse
|
||||
=, format
|
||||
|_ fed/(list post:twitter)
|
||||
++ grab
|
||||
|%
|
||||
|
@ -2,16 +2,14 @@
|
||||
:::: /hoon/tree/write/mar
|
||||
::
|
||||
/? 310
|
||||
/+ old-zuse
|
||||
::
|
||||
=, mimes:html
|
||||
=, old-zuse
|
||||
=, format
|
||||
|_ {sup/spur mim/mime}
|
||||
++ grab
|
||||
|%
|
||||
++ noun {spur mime}
|
||||
++ json
|
||||
%+ corl need :: XX {pax, mite, octs}
|
||||
=>(jo (ot sup+(su fel:stab) mime+(cu |=(a/@t [/ (as-octs a)]) so) ~))
|
||||
=,(dejs (ot sup+(su fel:stab) mime+(cu |=(a/@t [/ (as-octs a)]) so) ~))
|
||||
--
|
||||
--
|
||||
|
@ -6351,7 +6351,11 @@
|
||||
:+ %pin [%name %b [%per [%limb %v] q.gen]] :: =+ b==>(v {q.gen})
|
||||
:+ %pin :: =+ c=(a b)
|
||||
[%name %c [%call [%limb %a] [%limb %b] ~]] ::
|
||||
[%sure [%same [%limb %c] [%limb %b]] [%limb %c]] :: ?>(=(c b) c)
|
||||
:+ %sure :: ?>(=(`*`c `*`b) c)
|
||||
:+ %same ::
|
||||
[%cast [%base %noun] [%limb %c]] ::
|
||||
[%cast [%base %noun] [%limb %b]] ::
|
||||
[%limb %c] ::
|
||||
::
|
||||
{$new *}
|
||||
[%pin ~(bunt al %herb p.gen) q.gen]
|
||||
@ -8969,7 +8973,7 @@
|
||||
['.' (rune dot %trap expa)]
|
||||
['/' (rune fas %door expr)]
|
||||
['-' (rune hep %loop expa)]
|
||||
['^' (rune ket %cork expr)]
|
||||
['^' (rune ket %cork expx)]
|
||||
['~' (rune sig %port expb)]
|
||||
['*' (rune tar %gill expb)]
|
||||
['=' (rune tis %gate expb)]
|
||||
@ -9023,7 +9027,7 @@
|
||||
(word %trap expa)
|
||||
(word %door expr)
|
||||
(word %loop expa)
|
||||
(word %cork expr)
|
||||
(word %cork expx)
|
||||
(word %port expb)
|
||||
(word %gill expb)
|
||||
(word %gate expb)
|
||||
@ -9356,8 +9360,15 @@
|
||||
++ expu |.(;~(gunk rope loaf (butt hank))) :: wing, twig, twigs
|
||||
++ expv |.((butt rick)) :: just changes
|
||||
++ expw |.(;~(gunk rope loaf loaf loaf)) :: wing and three twigs
|
||||
++ expx |. ;~ gunk loaf :: twig and core tail
|
||||
%+ sear ::
|
||||
|= a/(map term foot) ::
|
||||
?:((~(has by a) %$) ~ [~ u=a]) :: (with no $ arm)
|
||||
wisp ::
|
||||
== ::
|
||||
++ expz |.(loaf(bug &)) :: twig with tracing
|
||||
::
|
||||
::
|
||||
:: tiki expansion for %wt runes
|
||||
::
|
||||
++ tkhp |. %+ cook |= {a/tiki b/(list (pair twig twig))}
|
||||
|
@ -284,7 +284,7 @@ window.urb.unsubscribe = function(params,cb) { // legacy intreface
|
||||
|
||||
window.urb.util = {
|
||||
isURL: function(s) {
|
||||
r = new RegExp('^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$', 'i');
|
||||
r = new RegExp('^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$', 'i');
|
||||
return s.length < 2083 && r.test(s);
|
||||
},
|
||||
numDot: function(n) {
|
||||
|
Loading…
Reference in New Issue
Block a user