mirror of https://gitlab.com/ceda_ei/wish
Subtract length of powerline symbols from prompt length max length.
This commit is contained in:
parent
48ff98764d
commit
c53939cdfe
|
@ -24,7 +24,7 @@ function wish_path_lensum() {
|
||||||
function wish_path_powerline_shrink() {
|
function wish_path_powerline_shrink() {
|
||||||
local IFS='/'
|
local IFS='/'
|
||||||
local path=( $1 )
|
local path=( $1 )
|
||||||
local max=$2
|
local max=$(( $2 - 3 * ${#path[@]} ))
|
||||||
for ((i=0; i <$((${#path[@]} - 1)); i++)); do
|
for ((i=0; i <$((${#path[@]} - 1)); i++)); do
|
||||||
path[$i]=${path[$i]:0:1}
|
path[$i]=${path[$i]:0:1}
|
||||||
if [[ $(wish_path_lensum ${path[@]}) -lt $max ]]; then
|
if [[ $(wish_path_lensum ${path[@]}) -lt $max ]]; then
|
||||||
|
|
Loading…
Reference in New Issue