Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: tab inserts literal tab instead of completing at beginning of line
- X-seq: zsh-workers 29319
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: tab inserts literal tab instead of completing at beginning of line
- Date: Thu, 19 May 2011 11:36:59 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=gnJ/IRwOIcjXYcwnyNPNuEfLEiCbqOy0wtl0GCM1yJU=; b=MOGoorNZDg+1atlJVb+qckxa/K+1oYUScYO22sfO632Yp1lgF+ulV4ehwG0+Y2rUll OLR1ZPD9SwjTdt6r/GdVRNxluB/iBV9vuxvj3/InEYVIMesqSLQKvYigY9aOzbZwzyKK PzcyMmyV12Lrkvyn9Ie6JJimpn1o22lh7srtk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=wiirVicxtiPbQRhE1wceh4nWYCm37UGCQLOBSeT8tWjCc/5Kbz+0NpAnwKrGLZn68Y AD5DSYGmkZE2w25ESva67Go1UGBRH+azbfsjx6eDU4m2WHJAVqozkws4n2/aguKf3UTZ mRi4vw4uNolZ4YLYFCQ0qDY5sqUgRIuN7JG9g=
- In-reply-to: <BANLkTin2p-bfoubfa1Cc_Ak-7T+0sPtx4Q@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <BANLkTimMcVWMzXnyJbFfuY2iDcOW2gJtug@mail.gmail.com> <BANLkTin2p-bfoubfa1Cc_Ak-7T+0sPtx4Q@mail.gmail.com>
On 19 May 2011 07:47, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Wed, May 18, 2011 at 3:37 PM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>>
>> Yes, this actually happened to me. If I were to find where this
>> special tab-insert-at-start-of-line handling is, could I disable it,
>> or do I need to add an option?
>
> See the doc for the insert-tab zstyle.
>
>> There's always ctrl-v tab, and why do
>> you want to write literal tabs at the start of the line anyway; to
>> paste random indented scriptlets?
>
> Generally speaking, yes.
>
>> If that's why, maybe I can make the
>> thing check if the line is empty instead of $cursor==0?
>
> Or try the "pending" setting of the style. If testing for pending
> input were more reliable, we might make that the default instead of
> "true".
Well, in my case there's no more input, just me pressing tab. How's
this? (it works)
--- 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