mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 7.2-269
This commit is contained in:
parent
badfde1bfe
commit
3f269675d4
@ -144,6 +144,13 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
|
|||||||
-u NORC no yes
|
-u NORC no yes
|
||||||
--noplugin yes no
|
--noplugin yes no
|
||||||
|
|
||||||
|
--startuptime={fname} *--startuptime*
|
||||||
|
During startup write timing messages to the file {fname}.
|
||||||
|
This can be used to find out where time is spent while loading
|
||||||
|
your .vimrc and plugins.
|
||||||
|
When {fname} already exists new messages are appended.
|
||||||
|
{only when compiled with this feature}
|
||||||
|
|
||||||
*--literal*
|
*--literal*
|
||||||
--literal Take file names literally, don't expand wildcards. Not needed
|
--literal Take file names literally, don't expand wildcards. Not needed
|
||||||
for Unix, because Vim always takes file names literally (the
|
for Unix, because Vim always takes file names literally (the
|
||||||
@ -471,6 +478,7 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
|
|||||||
window title and copy/paste using the X clipboard. This
|
window title and copy/paste using the X clipboard. This
|
||||||
avoids a long startup time when running Vim in a terminal
|
avoids a long startup time when running Vim in a terminal
|
||||||
emulator and the connection to the X server is slow.
|
emulator and the connection to the X server is slow.
|
||||||
|
See |--startuptime| to find out if affects you.
|
||||||
Only makes a difference on Unix or VMS, when compiled with the
|
Only makes a difference on Unix or VMS, when compiled with the
|
||||||
|+X11| feature. Otherwise it's ignored.
|
|+X11| feature. Otherwise it's ignored.
|
||||||
To disable the connection only for specific terminals, see the
|
To disable the connection only for specific terminals, see the
|
||||||
|
@ -844,10 +844,14 @@
|
|||||||
/* #define DEBUG */
|
/* #define DEBUG */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* STARTUPTIME Time the startup process. Writes a "vimstartup" file
|
* STARTUPTIME Time the startup process. Writes a file with
|
||||||
* with timestamps.
|
* timestamps.
|
||||||
*/
|
*/
|
||||||
/* #define STARTUPTIME "vimstartup" */
|
#if defined(FEAT_NORMAL) \
|
||||||
|
&& ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \
|
||||||
|
|| defined(WIN3264))
|
||||||
|
# define STARTUPTIME 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MEM_PROFILE Debugging of memory allocation and freeing.
|
* MEM_PROFILE Debugging of memory allocation and freeing.
|
||||||
|
@ -1567,6 +1567,10 @@ EXTERN int xsmp_icefd INIT(= -1); /* The actual connection */
|
|||||||
/* For undo we need to know the lowest time possible. */
|
/* For undo we need to know the lowest time possible. */
|
||||||
EXTERN time_t starttime;
|
EXTERN time_t starttime;
|
||||||
|
|
||||||
|
#ifdef STARTUPTIME
|
||||||
|
EXTERN FILE *time_fd INIT(= NULL); /* where to write startup timing */
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some compilers warn for not using a return value, but in some situations we
|
* Some compilers warn for not using a return value, but in some situations we
|
||||||
* can't do anything useful with the value. Assign to this variable to avoid
|
* can't do anything useful with the value. Assign to this variable to avoid
|
||||||
|
@ -243,7 +243,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STARTUPTIME
|
#ifdef STARTUPTIME
|
||||||
# define TIME_MSG(s) time_msg(s, NULL)
|
# define TIME_MSG(s) { if (time_fd != NULL) time_msg(s, NULL); }
|
||||||
#else
|
#else
|
||||||
# define TIME_MSG(s)
|
# define TIME_MSG(s)
|
||||||
#endif
|
#endif
|
||||||
|
60
src/main.c
60
src/main.c
@ -130,10 +130,6 @@ static char_u *serverMakeName __ARGS((char_u *arg, char *cmd));
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef STARTUPTIME
|
|
||||||
static FILE *time_fd = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Different types of error messages.
|
* Different types of error messages.
|
||||||
*/
|
*/
|
||||||
@ -173,6 +169,9 @@ main
|
|||||||
char_u *fname = NULL; /* file name from command line */
|
char_u *fname = NULL; /* file name from command line */
|
||||||
mparm_T params; /* various parameters passed between
|
mparm_T params; /* various parameters passed between
|
||||||
* main() and other functions. */
|
* main() and other functions. */
|
||||||
|
#ifdef STARTUPTIME
|
||||||
|
int i;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do any system-specific initialisations. These can NOT use IObuff or
|
* Do any system-specific initialisations. These can NOT use IObuff or
|
||||||
@ -203,8 +202,15 @@ main
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STARTUPTIME
|
#ifdef STARTUPTIME
|
||||||
time_fd = mch_fopen(STARTUPTIME, "a");
|
for (i = 1; i < argc; ++i)
|
||||||
|
{
|
||||||
|
if (STRNICMP(argv[i], "--startuptime=", 14) == 0)
|
||||||
|
{
|
||||||
|
time_fd = mch_fopen(argv[i] + 14, "a");
|
||||||
TIME_MSG("--- VIM STARTING ---");
|
TIME_MSG("--- VIM STARTING ---");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
starttime = time(NULL);
|
starttime = time(NULL);
|
||||||
|
|
||||||
@ -1150,6 +1156,18 @@ main_loop(cmdwin, noexmode)
|
|||||||
cursor_on();
|
cursor_on();
|
||||||
|
|
||||||
do_redraw = FALSE;
|
do_redraw = FALSE;
|
||||||
|
|
||||||
|
#ifdef STARTUPTIME
|
||||||
|
/* Now that we have drawn the first screen all the startup stuff
|
||||||
|
* has been done, close any file for startup messages. */
|
||||||
|
if (time_fd != NULL)
|
||||||
|
{
|
||||||
|
TIME_MSG("first screen update");
|
||||||
|
TIME_MSG("--- VIM STARTED ---");
|
||||||
|
fclose(time_fd);
|
||||||
|
time_fd = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
if (need_mouse_correct)
|
if (need_mouse_correct)
|
||||||
@ -1743,6 +1761,10 @@ command_line_scan(parmp)
|
|||||||
/* already processed, skip */
|
/* already processed, skip */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
else if (STRNICMP(argv[0] + argv_idx, "startuptime", 11) == 0)
|
||||||
|
{
|
||||||
|
/* already processed, skip */
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (argv[0][argv_idx])
|
if (argv[0][argv_idx])
|
||||||
@ -3211,6 +3233,20 @@ static void time_diff __ARGS((struct timeval *then, struct timeval *now));
|
|||||||
|
|
||||||
static struct timeval prev_timeval;
|
static struct timeval prev_timeval;
|
||||||
|
|
||||||
|
# ifdef WIN3264
|
||||||
|
/*
|
||||||
|
* Windows doesn't have gettimeofday(), although it does have struct timeval.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
gettimeofday(struct timeval *tv, char *dummy)
|
||||||
|
{
|
||||||
|
long t = clock();
|
||||||
|
tv->tv_sec = t / CLOCKS_PER_SEC;
|
||||||
|
tv->tv_usec = (t - tv->tv_sec * CLOCKS_PER_SEC) * 1000000 / CLOCKS_PER_SEC;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Save the previous time before doing something that could nest.
|
* Save the previous time before doing something that could nest.
|
||||||
* set "*tv_rel" to the time elapsed so far.
|
* set "*tv_rel" to the time elapsed so far.
|
||||||
@ -3299,20 +3335,6 @@ time_msg(msg, tv_start)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef WIN3264
|
|
||||||
/*
|
|
||||||
* Windows doesn't have gettimeofday(), although it does have struct timeval.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
gettimeofday(struct timeval *tv, char *dummy)
|
|
||||||
{
|
|
||||||
long t = clock();
|
|
||||||
tv->tv_sec = t / CLOCKS_PER_SEC;
|
|
||||||
tv->tv_usec = (t - tv->tv_sec * CLOCKS_PER_SEC) * 1000000 / CLOCKS_PER_SEC;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FEAT_CLIENTSERVER) || defined(PROTO)
|
#if defined(FEAT_CLIENTSERVER) || defined(PROTO)
|
||||||
|
@ -676,6 +676,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
269,
|
||||||
/**/
|
/**/
|
||||||
268,
|
268,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user