From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11727 invoked by alias); 19 May 2011 09:37:08 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29319 Received: (qmail 11339 invoked from network); 19 May 2011 09:37:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 as permitted sender) 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= MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 19 May 2011 11:36:59 +0200 Message-ID: Subject: Re: tab inserts literal tab instead of completing at beginning of line From: Mikael Magnusson To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset=UTF-8 On 19 May 2011 07:47, Bart Schaefer wrote: > On Wed, May 18, 2011 at 3:37 PM, Mikael Magnusson 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