foxshell/fn/z4h-accept-line
2025-07-04 11:48:40 -05:00

10 lines
239 B
Bash

#!/usr/bin/env zsh
#
# z4h-accept-line is just like accept-line except that it inserts \n when
# accept-line would result in a parse error or PS2.
if -z4h-is-valid-list "$PREBUFFER$BUFFER"; then
zle accept-line
else
LBUFFER+=$'\n'
fi