Skip to content

Commit f027565

Browse files
committed
fix(expand and accept): respect trailing whitespace
1 parent bbf08d0 commit f027565

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

zsh-abbr.zsh

+7-1
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,13 @@ _zsh_abbr_cmd_expansion() {
840840
}
841841

842842
_zsh_abbr_expand_and_accept() {
843-
zle _zsh_abbr_expand_widget
843+
local trailing_space
844+
trailing_space=${LBUFFER##*[^[:IFSSPACE:]]}
845+
846+
if [[ -z $trailing_space ]]; then
847+
zle _zsh_abbr_expand_widget
848+
fi
849+
844850
zle accept-line
845851
}
846852

0 commit comments

Comments
 (0)