mirror of
https://gitlab.com/ceda_ei/wish
synced 2025-10-30 22:10:09 +01:00
Subtract length of powerline symbols from prompt length max length.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user