summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/zle_hist.c2
-rw-r--r--Src/Zle/zle_params.c13
2 files changed, 14 insertions, 1 deletions
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index 70d8699c0..c6fb7acdb 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -715,6 +715,8 @@ void
 free_isrch_spots(void)
 {
     zfree(isrch_spots, max_spot * sizeof(*isrch_spots));
+    max_spot = 0;
+    isrch_spots = NULL;
 }
 
 /**/
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))
 {