Skip to content

Commit 6400e75

Browse files
committed
use zsh globbing instead of subshell pipeline
1 parent caa4fd0 commit 6400e75

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

init.zsh

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ _prompt_mnml_buffer-empty() {
1111
if (( MNML_LAST_ERR )) print -Pn '%F{${MNML_ERR_COLOR}}${MNML_LAST_ERR} '
1212
print -Pn '%(1j.%F{244}%j%f& .)%F{244}%n%f@%F{244}%m%f:'
1313
print -Pn %F{244}${${(%):-%~}//\//%f\/%F{244}}
14-
local -i a_files=$(command ls -Aq | command wc -l)
15-
local -i v_files=$(command ls -q | command wc -l)
16-
local -i h_files=$(( a_files - v_files ))
17-
print -Pn " %f[%F{244}${v_files}%f"
18-
if (( h_files )) print -Pn " (%F{244}${h_files}%f)"
14+
local -a a_files=(*(DN))
15+
local -a v_files=(*(N^D))
16+
local -a h_files=(${a_files:|v_files})
17+
print -Pn " %f[%F{244}${#v_files}%f"
18+
if (( #h_files )) print -Pn " (%F{244}${#h_files}%f)"
1919
print ]
2020
# display magic enter
2121
if (( ${#dirstack} )) print -P %F{244}${${dirstack/${HOME}/\~}//\//%f\/%F{244}}%f

0 commit comments

Comments
 (0)