patch 9.1.0808: Terminal scrollback doesn't shrink when decreasing 'termwinscroll'
Problem: Terminal scrollback doesn't shrink when reducing
'termwinscroll'
Solution: Check if option value was decreased (Milly).
closes: #15904
Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/option.c b/src/option.c
index 179c61e..84c469e 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4259,6 +4259,26 @@
}
#endif
+#if defined(FEAT_TERMINAL) || defined(PROTO)
+/*
+ * Process the updated 'termwinscroll' option value.
+ */
+ char *
+did_set_termwinscroll(optset_T *args)
+{
+ long *pp = (long *)args->os_varp;
+ char *errmsg = NULL;
+
+ if (*pp < 1)
+ {
+ errmsg = e_argument_must_be_positive;
+ *pp = 1;
+ }
+
+ return errmsg;
+}
+#endif
+
/*
* Process the updated 'terse' option value.
*/