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

Re: tab inserts literal tab instead of completing at beginning of line



On Thu, May 19, 2011 at 2:36 AM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> Well, in my case there's no more input, just me pressing tab. How's
> this? (it works)

Sorry, I'm not sure what this does. Add an "empty" value to the
insert-tab style?  If so then that's OK, I think.

> --- a/Completion/Base/Core/_main_complete
> +++ b/Completion/Base/Core/_main_complete
> @@ -44,7 +44,8 @@
>
>  if [[ ( "$tmp" = *pending(|[[:blank:]]*) && PENDING -gt 0 ) ||
>       ( "$tmp" = *pending=(#b)([0-9]##)(|[[:blank:]]*) &&
> -        PENDING -ge $match[1] ) ]]; then
> +        PENDING -ge $match[1] ) ||
> +      ( "$tmp" = empty && ${#${BUFFER##$'\t'#}} -eq 0 ) ]]; then
>   compstate[insert]=tab
>
>   return 0
>
>
> --
> Mikael Magnusson
>



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