Move zellij powerline to ide utils
parent
c55d0b2684
commit
709e6dc3d9
@ -0,0 +1,23 @@
|
||||
export def powerline [
|
||||
bg: string
|
||||
elem: list<any>
|
||||
--separator = ''
|
||||
--start = ''
|
||||
--end = ''
|
||||
] {
|
||||
if ($elem | is-empty) {
|
||||
return
|
||||
}
|
||||
let first = ($elem | first)
|
||||
let last = ($elem | last)
|
||||
|
||||
($elem
|
||||
| window 2
|
||||
| each {|it|
|
||||
$"(ansi {fg: $it.0.fg, bg: $it.0.bg})($it.0.icon? | default '') ($it.0.text? | default '')(ansi {fg: $it.0.bg, bg: $it.1.bg})($separator)"
|
||||
}
|
||||
| append $"(ansi {fg: $last.fg, bg: $last.bg})($last.icon? | default '') ($last.text? | default '')(ansi {fg: $last.bg, bg: $bg})($end)(ansi reset)"
|
||||
| prepend $"(ansi {fg: $bg, bg: $first.bg})($start)"
|
||||
| str join ""
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue