Merge pull request #105 from mafredri/master

Fix prompt precmd spacing.
This commit is contained in:
Sindre Sorhus
2015-02-23 12:56:04 +07:00

View File

@@ -20,6 +20,7 @@
# turns seconds into human readable time
# 165392 => 1d 21h 56m 32s
prompt_pure_human_time() {
echo -n " "
local tmp=$1
local days=$(( tmp / 60 / 60 / 24 ))
local hours=$(( tmp / 60 / 60 % 24 ))
@@ -61,7 +62,8 @@ prompt_pure_preexec() {
# string length ignoring ansi escapes
prompt_pure_string_length() {
echo ${#${(S%%)1//(\%([KF1]|)\{*\}|\%[Bbkf])}}
# Subtract one since newline is counted as two characters
echo $(( ${#${(S%%)1//(\%([KF1]|)\{*\}|\%[Bbkf])}} - 1 ))
}
prompt_pure_precmd() {