diff options
Diffstat (limited to 'Src/Zle/zle_params.c')
-rw-r--r-- | Src/Zle/zle_params.c | 13 |
1 files changed, 12 insertions, 1 deletions
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 }, @@ -326,6 +326,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)) { |