From f0275653a93579ba66caa01abbeef950bef31b39 Mon Sep 17 00:00:00 2001 From: Henry Bley-Vroman Date: Sat, 7 Mar 2020 16:38:38 -0500 Subject: [PATCH] fix(expand and accept): respect trailing whitespace --- zsh-abbr.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zsh-abbr.zsh b/zsh-abbr.zsh index 8a943cd5..d86a5b27 100755 --- a/zsh-abbr.zsh +++ b/zsh-abbr.zsh @@ -840,7 +840,13 @@ _zsh_abbr_cmd_expansion() { } _zsh_abbr_expand_and_accept() { - zle _zsh_abbr_expand_widget + local trailing_space + trailing_space=${LBUFFER##*[^[:IFSSPACE:]]} + + if [[ -z $trailing_space ]]; then + zle _zsh_abbr_expand_widget + fi + zle accept-line }