diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-11-03 19:32:42 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-11-03 19:32:42 +0100 |
commit | dba01a0197fefb4cf9b2357b9db001baecba25a0 (patch) | |
tree | 659eef231d92b94eaacb1fb5f8f520dc057760bf | |
parent | 16a6165bb31ca9d4f4a79739a1f3fa53f913267a (diff) | |
download | vim-dba01a0197fefb4cf9b2357b9db001baecba25a0.zip |
updated for version 7.3.048
Problem: ":earlier 1f" doesn't work after loading undo file.
Solution: Set b_u_save_nr_cur when loading an undo file. (Christian
Brabandt)
Fix only showing time in ":undolist"
-rw-r--r-- | src/undo.c | 15 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/undo.c b/src/undo.c index 376913d53..8fb46e4b7 100644 --- a/src/undo.c +++ b/src/undo.c @@ -1861,6 +1861,7 @@ u_read_undo(name, hash, orig_name) curbuf->b_u_seq_cur = seq_cur; curbuf->b_u_time_cur = seq_time; curbuf->b_u_save_nr_last = last_save_nr; + curbuf->b_u_save_nr_cur = last_save_nr; curbuf->b_u_synced = TRUE; vim_free(uhp_table); @@ -2794,7 +2795,7 @@ ex_undolist(eap) uhp->uh_time); if (uhp->uh_save_nr > 0) { - while (STRLEN(IObuff) < 32) + while (STRLEN(IObuff) < 33) STRCAT(IObuff, " "); vim_snprintf_add((char *)IObuff, IOSIZE, " %3ld", uhp->uh_save_nr); @@ -2849,7 +2850,7 @@ ex_undolist(eap) sort_strings((char_u **)ga.ga_data, ga.ga_len); msg_start(); - msg_puts_attr((char_u *)_("number changes time saved"), + msg_puts_attr((char_u *)_("number changes when saved"), hl_attr(HLF_T)); for (i = 0; i < ga.ga_len && !got_int; ++i) { @@ -2879,7 +2880,15 @@ u_add_time(buf, buflen, tt) if (time(NULL) - tt >= 100) { curtime = localtime(&tt); - (void)strftime((char *)buf, buflen, "%H:%M:%S", curtime); + if (time(NULL) - tt < (60L * 60L * 12L)) + /* within 12 hours */ + (void)strftime((char *)buf, buflen, "%H:%M:%S", curtime); + else if (time(NULL) - tt < (60L * 60L * 24L * 180L)) + /* within 6 months */ + (void)strftime((char *)buf, buflen, "%m/%d %H:%M:%S", curtime); + else + /* long ago */ + (void)strftime((char *)buf, buflen, "%y/%m/%d %H:%M:%S", curtime); } else #endif diff --git a/src/version.c b/src/version.c index 1a5bd9fd9..adfe2a332 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 48, +/**/ 47, /**/ 46, |