* PATCH: fix vi-goto-mark to allow jumps to the last mark @ 2011-01-09 17:11 David Bitseff 2011-01-09 21:09 ` Peter Stephenson 0 siblings, 1 reply; 5+ messages in thread From: David Bitseff @ 2011-01-09 17:11 UTC (permalink / raw) To: zsh-workers 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 The patch below appears to solve the problem. diff --git a/Src/Zle/zle_move.c b/Src/Zle/zle_move.c index f15b114..32ed76d 100644 --- a/Src/Zle/zle_move.c +++ b/Src/Zle/zle_move.c @@ -807,7 +807,7 @@ vigotomark(UNUSED(char **args)) ch = getfullchar(0); if (ch == lfc) - ch = 26; + ch -= ZWC('a'); else { if (ch < ZWC('a') || ch > ZWC('z')) return 1; ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH: fix vi-goto-mark to allow jumps to the last mark 2011-01-09 17:11 PATCH: fix vi-goto-mark to allow jumps to the last mark David Bitseff @ 2011-01-09 21:09 ` Peter Stephenson 2011-01-09 23:58 ` Bart Schaefer 2011-01-10 1:44 ` David Bitseff 0 siblings, 2 replies; 5+ messages in thread From: Peter Stephenson @ 2011-01-09 21:09 UTC (permalink / raw) To: David Bitseff, zsh-workers On Sun, 9 Jan 2011 09:11:07 -0800 David Bitseff <bitsed@gmail.com> 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 <p.w.stephenson@ntlworld.com> Web page now at http://homepage.ntlworld.com/p.w.stephenson/ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH: fix vi-goto-mark to allow jumps to the last mark 2011-01-09 21:09 ` Peter Stephenson @ 2011-01-09 23:58 ` Bart Schaefer 2011-01-10 9:42 ` Peter Stephenson 2011-01-10 1:44 ` David Bitseff 1 sibling, 1 reply; 5+ messages in thread From: Bart Schaefer @ 2011-01-09 23:58 UTC (permalink / raw) To: zsh-workers On Jan 9, 9:09pm, Peter Stephenson wrote: } } I've never understood what the code you've modified is actually for, } since mark 26 never gets set. Isn't 26 supposed to be the unnamed default mark that e.g. '' (two single quotes in succession) jumps you back to? In effect, it's supposed to be the same as emacs-mode $MARK. -- ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH: fix vi-goto-mark to allow jumps to the last mark 2011-01-09 23:58 ` Bart Schaefer @ 2011-01-10 9:42 ` Peter Stephenson 0 siblings, 0 replies; 5+ messages in thread From: Peter Stephenson @ 2011-01-10 9:42 UTC (permalink / raw) To: zsh-workers On Sun, 9 Jan 2011 15:58:10 -0800 Bart Schaefer <schaefer@brasslantern.com> wrote: > On Jan 9, 9:09pm, Peter Stephenson wrote: > } > } I've never understood what the code you've modified is actually for, > } since mark 26 never gets set. > > Isn't 26 supposed to be the unnamed default mark that e.g. '' (two > single quotes in succession) jumps you back to? > > In effect, it's supposed to be the same as emacs-mode $MARK. Possibly, but it's never set; the vi mark code is only set by vi-set-mark where the range is restricted to 'a' to 'z' (0 to 25). -- Peter Stephenson <pws@csr.com> Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH: fix vi-goto-mark to allow jumps to the last mark 2011-01-09 21:09 ` Peter Stephenson 2011-01-09 23:58 ` Bart Schaefer @ 2011-01-10 1:44 ` David Bitseff 1 sibling, 0 replies; 5+ messages in thread From: David Bitseff @ 2011-01-10 1:44 UTC (permalink / raw) To: zsh-workers On Sunday, January 09, 2011 1:09:56 pm Peter Stephenson wrote: > 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. I've built the shell with the --enable-multibyte option. It works as expected without a patch if I build the shell using --disable-multibyte. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-01-10 9:43 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-01-09 17:11 PATCH: fix vi-goto-mark to allow jumps to the last mark David Bitseff 2011-01-09 21:09 ` Peter Stephenson 2011-01-09 23:58 ` Bart Schaefer 2011-01-10 9:42 ` Peter Stephenson 2011-01-10 1:44 ` David Bitseff
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/zsh/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).