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

Re: z-sy-h and z-asug: zle-line-pre-redraw, POSTDISPLAY, coexistence (was: Re: emulate bash key bindings)



Roman Perepelitsa wrote on Fri, 10 Jan 2020 18:43 +00:00:
> On Fri, Jan 10, 2020 at 7:29 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > I assume that a dummy widget that does «{ POSTDISPLAY=foo;
> > region_highlight+=( "$#BUFFER $(($#BUFFER + 2)) bold" ) }»
> > could be used to mock z-asug for the purposes of the coexistence
> > issue?
> 
> Yeah, I think so. Perhaps use $#POSTDISPLAY instead of 2 to avoid
> mistakes there.

Thanks for confirming, and ack.

> For example, given this zsh code:
> 
>   () { sudo foo bar && baz }
> 
> I want to get "sudo" "foo" and "baz".

The '{' is in command position as well.  Consider «() pwd».

> I've written some code that works decently well but needs a bit more
> polish. It's more precise than z-sy-h

If you know if any cases z-sy-h doesn't handle, please let us know :)

> but still doesn't handle some corner cases. For example, given
> this setup:
> 
>   setopt interactive_comments
>   alias foo='bar #'
> 
> My code incorrectly extracts "bar" and "baz" from "foo; baz". It
> should be just "bar" here.

*nod*

Cheers,

Daniel



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