From 43c6bc6619d70c144429dd50bbbef2eedf7ac1f1 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 17 Mar 2019 19:46:40 +0100 Subject: [PATCH] tweaks: add a consistency check plus a corresponding warning Since commit 4c6ec637 from about half a year ago, the 'action' parameter of update_undo() is unused. Verify that this parameter matches the type of the item at the top of the undo stack, so that in another half year the parameter can be safely removed. --- src/text.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/text.c b/src/text.c index fcd81134..e7a87659 100644 --- a/src/text.c +++ b/src/text.c @@ -1313,6 +1313,9 @@ void update_undo(undo_type action) char *char_buf; int char_len; + if (u->type != action) + statusline(ALERT, "Mismatching undo type -- please report a bug"); + u->newsize = openfile->totsize; switch (u->type) {