From efe2876d927b5d028031a6023b622be44c5d5b8a Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 29 Jul 2004 14:21:57 +0000 Subject: 20219: make zle parameter HISTNO writeable add history-pattern-search widget --- Src/Zle/zle_params.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Src/Zle/zle_params.c') diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c index f2eaea723..f0f1cde95 100644 --- a/Src/Zle/zle_params.c +++ b/Src/Zle/zle_params.c @@ -75,7 +75,7 @@ static struct zleparam { zleunsetfn, NULL }, { "NUMERIC", PM_INTEGER | PM_UNSET, FN(set_numeric), FN(get_numeric), unset_numeric, NULL }, - { "HISTNO", PM_INTEGER | PM_READONLY, NULL, FN(get_histno), + { "HISTNO", PM_INTEGER, FN(set_histno), FN(get_histno), zleunsetfn, NULL }, { "BUFFERLINES", PM_INTEGER | PM_READONLY, NULL, FN(get_bufferlines), zleunsetfn, NULL }, @@ -325,6 +325,17 @@ unset_numeric(Param pm, int exp) } } +/**/ +static void +set_histno(UNUSED(Param pm), zlong x) +{ + Histent he; + + if (!(he = quietgethist((int)x))) + return; + zle_setline(he); +} + /**/ static zlong get_histno(UNUSED(Param pm)) -- cgit 1.4.1