Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: save last position in vi-goto-mark
- X-seq: zsh-workers 31037
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: save last position in vi-goto-mark
- Date: Fri, 08 Feb 2013 23:27:18 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1360362439; bh=kwEUCen0xYlypOQm93mj2ug9CoI4IUw5Mq1k8QSSt6g=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:Received:Received:From:To:Subject:Date:Message-ID; b=aWEjuRYtGpTQKTeiECFXo8TPZ9zB7OCI5/0DpkfdBsUYSjck3LpU6JxNGD2SXCmkySvmSGr4wTMKE651LDcNX68a/Nqw/Qg0hoJSXsTF/gOP7bjzZKdj5XJ7H45FnAO1HM1MgNDWWtSptweFe4tei6fIcRjq86mMpT3keabTRxw=
- 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
This actually backs out some of 28611 so perhaps this once worked in the
distant past. `` or '' should return to the previous position from before the
last jump. The rather pointless `' and '` will also do the same but they do in
vim too. I suspect that with the original implementation, LASTFULLCHAR was
returning ` or ' and avoiding this quirk but it now returns the character of
the recently set mark (hence the bug that 28611 fixed). The code for saving the
old position must have either got lost or was forgotten in the first place.
Oliver
diff --git a/Src/Zle/zle_move.c b/Src/Zle/zle_move.c
index 4653855..73c8e59 100644
--- a/Src/Zle/zle_move.c
+++ b/Src/Zle/zle_move.c
@@ -30,7 +30,7 @@
#include "zle.mdh"
#include "zle_move.pro"
-static int vimarkcs[26], vimarkline[26];
+static int vimarkcs[27], vimarkline[27];
#ifdef MULTIBYTE_SUPPORT
/*
@@ -834,11 +834,17 @@ int
vigotomark(UNUSED(char **args))
{
ZLE_INT_T ch;
+ int oldcs = zlecs;
+ int oldline = histline;
ch = getfullchar(0);
- if (ch < ZWC('a') || ch > ZWC('z'))
- return 1;
- ch -= ZWC('a');
+ if (ch == ZWC('\'') || ch == ZWC('`'))
+ ch = 26;
+ else {
+ 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)) {
@@ -846,6 +852,8 @@ vigotomark(UNUSED(char **args))
return 1;
}
zlecs = vimarkcs[ch];
+ vimarkcs[26] = oldcs;
+ vimarkline[26] = histline;
if (zlecs > zlell)
zlecs = zlell;
return 0;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author