about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-02-07 15:52:24 +0100
committerMichael Vetter <jubalh@iodoru.org>2020-02-07 15:52:24 +0100
commit772224421d7169189ee3be0afd2d15a349d4d6aa (patch)
treef54dc7d31c9e9bf2faa3f9dccd1239ade388c813 /src
parent7df964fe7bcd46b7d79c825f96c6cb8928924121 (diff)
downloadprofani-tty-772224421d7169189ee3be0afd2d15a349d4d6aa.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/ui/window.c2
1 files changed, 2 insertions, 0 deletions
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;
     }