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:
@@ -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, ...)
|
||||
|
Reference in New Issue
Block a user