Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Assigning BUFFER in accept-line kills comp remove logic
- X-seq: zsh-workers 53865
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Jörg Sommer <joerg@xxxxxxxx>
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: Assigning BUFFER in accept-line kills comp remove logic
- Date: Wed, 20 Aug 2025 19:15:08 -0700
- Archived-at: <https://zsh.org/workers/53865>
- In-reply-to: <fre6jhviwxryamnwpbhomvfidhchczvxsjpgz6wc2plgqkgkay@z4pmyxzf2iev>
- List-id: <zsh-workers.zsh.org>
- References: <fre6jhviwxryamnwpbhomvfidhchczvxsjpgz6wc2plgqkgkay@z4pmyxzf2iev>
On Wed, Aug 20, 2025 at 8:10 AM Jörg Sommer <joerg@xxxxxxxx> wrote:
>
> I have a function `accept-line` to modify the BUFFER before it goes into
> execution and into the history. Unfortunately, an assignment to BUFFER kills
> the logic that removes completion suggestions like SPACE, / or =.
>
[...]
>
> Is it possible to get this behaviour back?
You have to handle it yourself. There are ZLE variables to help.
accept-line () {
if (( SUFFIX_ACTIVE ))
then
BUFFER="${BUFFER[1,SUFFIX_START]}"
else
BUFFER="$BUFFER"
fi
zle .accept_line
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author