From e2f845632d68835dacccd477fd6c6a23e2da1249 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 4 Apr 2019 20:57:28 -0400 Subject: vim-patch:8.1.0308: a quick undo shows "1 seconds ago" Problem: A quick undo shows "1 seconds ago". (Tony Mechelynck) Solution: Add singular/plural message. https://github.com/vim/vim/commit/fd6100b2aa6178b88cfadcdbc494966bf79a5488 --- src/nvim/undo.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 1534a943e9..41393c7ef4 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -2587,9 +2587,13 @@ static void u_add_time(char_u *buf, size_t buflen, time_t tt) else /* longer ago */ (void)strftime((char *)buf, buflen, "%Y/%m/%d %H:%M:%S", &curtime); - } else - vim_snprintf((char *)buf, buflen, _("%" PRId64 " seconds ago"), - (int64_t)(time(NULL) - tt)); + } else { + int64_t seconds = time(NULL) - tt; + vim_snprintf((char *)buf, buflen, + NGETTEXT("%" PRId64 " second ago", + "%" PRId64 " seconds ago", (uint32_t)seconds), + seconds); + } } /* -- cgit