Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: make get-line widget update history number
- X-seq: zsh-workers 32450
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: make get-line widget update history number
- Date: Sat, 01 Mar 2014 01:20:37 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1393633238; bh=y4G4XMWSIX3gv0sl4p5fnC10vjg6vWrI9drF+ttJ+9E=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Received:From:To:Subject:MIME-Version:Content-Type:Content-ID:Date:Message-ID; b=yqnjCzeif8goJlF8gg+ptahCxPU7wV8bGnQnzkHt19xzpgGFjHPc/joMhSJds6obSrMKivDrUaPScTnDa83rpjOOF8KtF6tH5Q5Y4OkLqJttWHRl1LGC176dmu6u6trNkVs+ZYjmrcksx/EcHU+YGlIVMH/DTWjVz6fhE6KdgbU=
- 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
After accept-line-and-down-history, a get-line does not set the history
number (HISTNO).
I override history-incremental-search-backward to use
narrow-to-region when invoked on a non-empty buffer. This is useful for
retrieving history into, e.g the middle of a for loop.
With this change, if the recursive-edit was finished with an
accept-line-and-down-history, it can now call zle get-line, loop
back around and subsequent accept-line-and-down-historys will insert
subsequent history lines. This is probably also possible by manually
editing PRE/POSTDISPLAY and HISTNO but it's much easier this way.
I'm trying to think of things that this might possibly break but I
can't. I don't think I've ever used get-line before. Anyone else see a
problem?
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index bd5bc36..44b39d1 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -890,6 +890,10 @@ zgetline(UNUSED(char **args))
free(s);
free(lineadd);
clearlist = 1;
+ if (stackhist != -1) {
+ histline = stackhist;
+ stackhist = -1;
+ }
}
return 0;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author