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

Re: line continuation with sed



On Sun, Oct 16, 2022 at 8:40 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> On 2022-10-16 18:07, Bart Schaefer wrote:
> > You might find something like this interesting:
> That is really elegant.

Actually that implementation is kind of ugly.  I completely forgot
about this much prettier way:

show-trailing-space() {
  if [[ $BUFFER = *(' '|$' \n'*)
        || $PREBUFFER = *$' \n'* ]]
  then POSTDISPLAY=$'\u21a9'
  else unset POSTDISPLAY
  fi
}
zle -N show-trailing-space
add-zle-hook-widget line-pre-redraw show-trailing-space
add-zle-hook-widget history-line-set show-trailing-space




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