From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3899 invoked by alias); 9 Jan 2011 21:10:20 -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: 28611 Received: (qmail 4778 invoked from network); 9 Jan 2011 21:10:14 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at ntlworld.com designates 81.103.221.47 as permitted sender) Date: Sun, 9 Jan 2011 21:09:56 +0000 From: Peter Stephenson To: David Bitseff , zsh-workers@zsh.org Subject: Re: PATCH: fix vi-goto-mark to allow jumps to the last mark Message-ID: <20110109210956.04976fe2@pws-pc.ntlworld.com> In-Reply-To: <201101090911.07314.bitsed@gmail.com> References: <201101090911.07314.bitsed@gmail.com> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.0; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=JvdXmxIgLJv2/GthKqHpGJEEHukvLcvELVXUanXFreg= c=1 sm=0 a=hALXrKYgabMA:10 a=kj9zAlcOel0A:10 a=pGLkceISAAAA:8 a=NLZqzBF-AAAA:8 a=1RzFMdZHaDsS7QUsjIkA:9 a=RyBB57uWPAUm0gaUaV8A:7 a=GRauSQyvUEjG2B1zUUiECBhH0TwA:4 a=CjuIK1q_8ugA:10 a=MSl-tDqOz04A:10 a=_dQi-Dcv4p4A:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 On Sun, 9 Jan 2011 09:11:07 -0800 David Bitseff wrote: > I've noticed that the vi-goto-mark zle widget doesn't work as expected on my > system. If I try jumping to a mark that I just set using the vi-set-mark > widget there is no movement of the cursor. To replicate the problem: > > 1) use vi-up-line-or-history to recall a suitably long command > 2) use vi-forward-char a few times to move the cursor a bit > 3) set a mark using vi-set-mark > 4) use vi-forward-char a few times to move the cursor some more > 5) try jumping to the mark just created using vi-goto-mark > 6) notice no cursor movement I'm not sure what you're doing that's different to everyone else --- it must involve repeating the last character to go to the mark, so maybe you've got vi-goto-mark bound to a letter --- but I've never understood what the code you've modified is actually for, since mark 26 never gets set. It's probably best just to remove it. Index: Src/Zle/zle_move.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_move.c,v retrieving revision 1.18 diff -p -u -r1.18 zle_move.c --- Src/Zle/zle_move.c 5 May 2008 01:14:06 -0000 1.18 +++ Src/Zle/zle_move.c 9 Jan 2011 21:03:51 -0000 @@ -30,7 +30,7 @@ #include "zle.mdh" #include "zle_move.pro" -static int vimarkcs[27], vimarkline[27]; +static int vimarkcs[26], vimarkline[26]; #ifdef MULTIBYTE_SUPPORT /* @@ -803,16 +803,11 @@ int vigotomark(UNUSED(char **args)) { ZLE_INT_T ch; - LASTFULLCHAR_T lfc = LASTFULLCHAR; ch = getfullchar(0); - if (ch == lfc) - ch = 26; - else { - if (ch < ZWC('a') || ch > ZWC('z')) - return 1; - ch -= ZWC('a'); - } + if (ch < ZWC('a') || ch > ZWC('z')) + return 1; + ch -= ZWC('a'); if (!vimarkline[ch]) return 1; if (curhist != vimarkline[ch] && !zle_goto_hist(vimarkline[ch], 0, 0)) { -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/