Mercurial > vim
diff src/undo.c @ 9674:adc7212951ee v7.4.2113
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 29 16:15:27 2016 +0200
patch 7.4.2113
Problem: Test for undo is flaky.
Solution: Turn it into a new style test. Use test_settime() to avoid
flakyness.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 29 Jul 2016 16:30:06 +0200 |
parents | b2aada04d84e |
children | 4aead6a9b7a9 |
line wrap: on
line diff
--- a/src/undo.c +++ b/src/undo.c @@ -534,7 +534,7 @@ u_savecommon( uhp->uh_seq = ++curbuf->b_u_seq_last; curbuf->b_u_seq_cur = uhp->uh_seq; - uhp->uh_time = time(NULL); + uhp->uh_time = vim_time(); uhp->uh_save_nr = 0; curbuf->b_u_time_cur = uhp->uh_time + 1; @@ -2350,7 +2350,7 @@ undo_time( else { if (dosec) - closest = (long)(time(NULL) - starttime + 1); + closest = (long)(vim_time() - starttime + 1); else if (dofile) closest = curbuf->b_u_save_nr_last + 2; else @@ -3104,10 +3104,10 @@ u_add_time(char_u *buf, size_t buflen, t #ifdef HAVE_STRFTIME struct tm *curtime; - if (time(NULL) - tt >= 100) + if (vim_time() - tt >= 100) { curtime = localtime(&tt); - if (time(NULL) - tt < (60L * 60L * 12L)) + if (vim_time() - tt < (60L * 60L * 12L)) /* within 12 hours */ (void)strftime((char *)buf, buflen, "%H:%M:%S", curtime); else @@ -3117,7 +3117,7 @@ u_add_time(char_u *buf, size_t buflen, t else #endif vim_snprintf((char *)buf, buflen, _("%ld seconds ago"), - (long)(time(NULL) - tt)); + (long)(vim_time() - tt)); } /*