0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

Add file save counter to undo information. Add undotree() function.

This commit is contained in:
Bram Moolenaar
2010-06-27 01:15:55 +02:00
parent d69980f9dd
commit a800b42975
15 changed files with 355 additions and 63 deletions

View File

@@ -3973,6 +3973,47 @@ tv_float(tvs, idxp)
/* When generating prototypes all of this is skipped, cproto doesn't
* understand this. */
#ifndef PROTO
# ifdef HAVE_STDARG_H
/* Like vim_vsnprintf() but append to the string. */
int
vim_snprintf_add(char *str, size_t str_m, char *fmt, ...)
{
va_list ap;
int str_l;
size_t len = STRLEN(str);
size_t space;
if (str_m <= len)
space = 0;
else
space = str_m - len;
va_start(ap, fmt);
str_l = vim_vsnprintf(str + len, space, fmt, ap, NULL);
va_end(ap);
return str_l;
}
# else
/* Like vim_vsnprintf() but append to the string. */
int
vim_snprintf_add(str, str_m, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
char *str;
size_t str_m;
char *fmt;
long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
{
size_t len = STRLEN(str);
size_t space;
if (str_m <= len)
space = 0;
else
space = str_m - len;
return vim_vsnprintf(str + len, space, fmt,
a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
}
# endif
# ifdef HAVE_STDARG_H
int
vim_snprintf(char *str, size_t str_m, char *fmt, ...)