From 772224421d7169189ee3be0afd2d15a349d4d6aa Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 7 Feb 2020 15:52:24 +0100 Subject: [PATCH] Clear buffer upon /clear I think both the window and the buffer should also be cleared in case `/clear` is issue and persist_history is off. Otherwise it could happen that win_redraw() redraws the whole content of the buffer again. --- src/ui/window.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ui/window.c b/src/ui/window.c index 70d4ce11..c7bb359a 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -624,6 +624,8 @@ win_clear(ProfWin *window) { if (!prefs_get_boolean(PREF_CLEAR_PERSIST_HISTORY)) { werase(window->layout->win); + buffer_free(window->layout->buffer); + window->layout->buffer = buffer_create(); return; }