Skip to content

Commit 1724c4c

Browse files
committed
fix: completion with whitespace escape
Signed-off-by: wxiwnd <[email protected]>
1 parent 7ef47ad commit 1724c4c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scripts/bash_pinyin_completion

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ _pinyin_completion() {
6868
fi
6969
done | bash-pinyin-completion-rs "$basepart" 2>/dev/null
7070
)
71+
if [ ${#pinyin_matched[@]} -ne 0 ]; then
72+
compopt -o filenames 2>/dev/null
73+
fi
7174
fi
7275

7376
if [[ -n "$dirpart" ]]; then
@@ -99,8 +102,8 @@ _pinyin_completion() {
99102
done
100103
COMPREPLY=( "${unique_compreply[@]}" )
101104

102-
# fix space postfix
103-
if ((${#COMPREPLY[@]} == 1)) && [[ ${COMPREPLY[0]} != */ ]]; then
104-
compopt -o nospace 2>/dev/null
105-
fi
105+
# # fix space postfix
106+
# if ((${#COMPREPLY[@]} == 1)) && [[ ${COMPREPLY[0]} != */ ]]; then
107+
# compopt -o nospace 2>/dev/null
108+
# fi
106109
}

0 commit comments

Comments
 (0)