mirror of https://gitlab.com/ceda_ei/wish
[Feature] Add wish_remaining_chars.
wish_remaining_chars is to be used only in main functions of bodies
This commit is contained in:
parent
97fe2dbcc6
commit
136567e08e
13
wish.sh
13
wish.sh
|
@ -100,6 +100,7 @@ function wish_append_right() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Public API
|
||||||
# Usage: wish_append bg fg text
|
# Usage: wish_append bg fg text
|
||||||
#
|
#
|
||||||
# Parameters:
|
# Parameters:
|
||||||
|
@ -136,6 +137,18 @@ function wish_append() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Public API
|
||||||
|
# Usage: wish_remaining_chars
|
||||||
|
# Parameters: None
|
||||||
|
# Return Value: Capture stdout to get the remaining characters available in the
|
||||||
|
# line.
|
||||||
|
wish_remaining_chars() {
|
||||||
|
if [[ $WISH_STATE -eq 0 ]]; then
|
||||||
|
echo "$(( $COLUMNS - ${WISH_LPL[$WISH_LPLINE]} ))"
|
||||||
|
else
|
||||||
|
echo "$(( $COLUMNS - ${WISH_LPL[$WISH_RPLINE]} - ${WISH_RPL[$WISH_RPLINE]} ))"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function wish_main() {
|
function wish_main() {
|
||||||
local prev=$?
|
local prev=$?
|
||||||
|
|
Loading…
Reference in New Issue