simplify max columns number management
This commit is contained in:
parent
2c73402a31
commit
f7e3ad940c
@ -318,13 +318,7 @@ __shorten_path()
|
||||
local p=$(echo "$1" | sed -e "s|$HOME|~|")
|
||||
local len="${#p}"
|
||||
|
||||
if [ -z "$COLUMNS" ]
|
||||
then
|
||||
local columns=80
|
||||
else
|
||||
local columns=$COLUMNS
|
||||
fi
|
||||
local max_len=$(($columns*$len_percent/100))
|
||||
local max_len=$((${COLUMNS:-80}*$len_percent/100))
|
||||
local mask_len="${#mask}"
|
||||
|
||||
if [[ "$len" -gt "$max_len" ]]
|
||||
|
Loading…
Reference in New Issue
Block a user