Merge pull request #105 from mafredri/master
Fix prompt precmd spacing.
This commit is contained in:
4
pure.zsh
4
pure.zsh
@@ -20,6 +20,7 @@
|
|||||||
# turns seconds into human readable time
|
# turns seconds into human readable time
|
||||||
# 165392 => 1d 21h 56m 32s
|
# 165392 => 1d 21h 56m 32s
|
||||||
prompt_pure_human_time() {
|
prompt_pure_human_time() {
|
||||||
|
echo -n " "
|
||||||
local tmp=$1
|
local tmp=$1
|
||||||
local days=$(( tmp / 60 / 60 / 24 ))
|
local days=$(( tmp / 60 / 60 / 24 ))
|
||||||
local hours=$(( tmp / 60 / 60 % 24 ))
|
local hours=$(( tmp / 60 / 60 % 24 ))
|
||||||
@@ -61,7 +62,8 @@ prompt_pure_preexec() {
|
|||||||
|
|
||||||
# string length ignoring ansi escapes
|
# string length ignoring ansi escapes
|
||||||
prompt_pure_string_length() {
|
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() {
|
prompt_pure_precmd() {
|
||||||
|
|||||||
Reference in New Issue
Block a user