mirror of
https://github.com/urbit/shrub.git
synced 2025-01-05 19:46:50 +03:00
Dojo now uses the short ship name (ie ~todsel_lithex
or ~torbyt^sogwyx
) in the prompt. Dojo and talk now use dedicated function in lib/sole.hoon
for ship name shortening.
This commit is contained in:
parent
8cfbd216d1
commit
937438798d
@ -1875,21 +1875,8 @@
|
||||
++ sn-curt :: render name in 14
|
||||
|= mup/?
|
||||
^- tape
|
||||
=+ rac=(clan p.one)
|
||||
=+ raw=(scow %p p.one)
|
||||
=. raw ?.(mup raw ['*' (slag 2 raw)])
|
||||
?- rac
|
||||
$czar (weld " " raw)
|
||||
$king (weld " " raw)
|
||||
$duke raw
|
||||
$earl ;: welp
|
||||
(scag 1 raw)
|
||||
(scag 6 (slag 15 raw))
|
||||
"^"
|
||||
(scag 6 (slag 22 raw))
|
||||
==
|
||||
$pawn :(welp (scag 7 raw) "_" (scag 6 (slag 51 raw)))
|
||||
==
|
||||
=+ raw=(shortship %p p.one)
|
||||
(runt [(sub 14 (lent raw)) ' '] raw)
|
||||
::
|
||||
++ sn-nick
|
||||
|. ^- tape
|
||||
|
@ -968,7 +968,7 @@
|
||||
::
|
||||
++ ta-pro :: set prompt
|
||||
|= pom/sole-prompt
|
||||
+>(pom pom(cad :(welp (scow %p p.gyl) ":" (trip q.gyl) cad.pom)))
|
||||
+>(pom pom(cad :(welp (shortship:sole p.gyl) ":" (trip q.gyl) cad.pom)))
|
||||
::
|
||||
++ ta-ret :: hear return
|
||||
(ta-act %ret ~)
|
||||
|
@ -138,4 +138,15 @@
|
||||
=+ dat=(transmute [%mor leg] [%ins pos `@c`0])
|
||||
?> ?=($ins -.dat)
|
||||
p.dat
|
||||
::
|
||||
++ shortship
|
||||
|= ship/@p
|
||||
^- tape
|
||||
=+ kind=(clan ship)
|
||||
=+ name=(scow %p ship)
|
||||
?: =(%earl kind)
|
||||
:(weld "~" (swag [15 6] name) "^" (swag [22 6] name))
|
||||
?: =(%pawn kind)
|
||||
:(weld (swag [0 7] name) "_" (swag [51 6] name))
|
||||
name
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user