Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Assigning BUFFER in accept-line kills comp remove logic



Hello,

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 =.

```
% zsh -f
host% autoload -Uz compinit && compinit
host% alias r<TAB>
host% alias run-help=<RETURN>
host% alias run-help
run-help=man

host% accept-line() { BUFFER=$BUFFER; zle .accept-line; }
host% zle -N accept-line

host% alias r<TAB>
host% alias run-help=<RETURN>
host% alias run-help=
```

Before adding the function `accept-line` the `<RETURN>` removes the `=` from
the suggestion. Or the `/` when completing a directory.

But when the BUFFER in accept-line gets assigned, these suggested characters
are no longer removed.

Is it possible to get this behaviour back? Or is there a better way to
modify the BUFFER before it gets evaluated?


Kind regards, Jörg

-- 
Was man mühelos erreichen kann, ist gewöhnlich nicht der Mühe wert,
erreicht zu werden.

Attachment: signature.asc
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author