Compare commits

...

7 Commits

Author SHA1 Message Date
Bram Moolenaar
d0ba34a6e5 updated for version 7.2-272 2009-11-03 12:06:23 +00:00
Bram Moolenaar
0af561dbf2 updated for version 7.2-271 2009-11-03 11:53:55 +00:00
Bram Moolenaar
60462877cb updated for version 7.2-270 2009-11-03 11:40:19 +00:00
Bram Moolenaar
3f269675d4 updated for version 7.2-269 2009-11-03 11:11:11 +00:00
Bram Moolenaar
badfde1bfe updated for version 7.2-268 2009-11-03 10:43:27 +00:00
Bram Moolenaar
8701cd6a22 updated for version 7.2-267 2009-10-07 14:20:30 +00:00
Bram Moolenaar
da9591ecfd updated for version 7.2-266 2009-09-30 13:17:02 +00:00
16 changed files with 143 additions and 59 deletions

View File

@@ -224,6 +224,10 @@ expression is evaluated to obtain the {rhs} that is used. Example: >
The result of the InsertDot() function will be inserted. It could check the
text before the cursor and start omni completion when some condition is met.
For abbreviations |v:char| is set to the character that was typed to trigger
the abbreviation. You can use this to decide how to expand the {lhs}. You
can't change v:char and you should not insert it.
Be very careful about side effects! The expression is evaluated while
obtaining characters, you may very well make the command dysfunctional.
For this reason the following is blocked:

View File

@@ -144,6 +144,13 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
-u NORC no yes
--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 Take file names literally, don't expand wildcards. Not needed
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
avoids a long startup time when running Vim in a terminal
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
|+X11| feature. Otherwise it's ignored.
To disable the connection only for specific terminals, see the

View File

@@ -1218,6 +1218,8 @@ in_win_border(wp, vcol)
if ((int)vcol == width1 - 1)
return TRUE;
width2 = width1 + win_col_off2(wp);
if (width2 <= 0)
return FALSE;
return ((vcol - width1) % width2 == width2 - 1);
}
#endif /* FEAT_MBYTE */

View File

@@ -18100,6 +18100,31 @@ get_vim_var_list(idx)
return vimvars[idx].vv_list;
}
/*
* Set v:char to character "c".
*/
void
set_vim_var_char(c)
int c;
{
#ifdef FEAT_MBYTE
char_u buf[MB_MAXBYTES];
#else
char_u buf[2];
#endif
#ifdef FEAT_MBYTE
if (has_mbyte)
buf[(*mb_char2bytes)(c, buf)] = NUL;
else
#endif
{
buf[0] = c;
buf[1] = NUL;
}
set_vim_var_string(VV_CHAR, buf, -1);
}
/*
* Set v:count to "count" and v:count1 to "count1".
* When "set_prevcount" is TRUE first set v:prevcount from v:count.

View File

@@ -8358,6 +8358,7 @@ ex_at(eap)
exarg_T *eap;
{
int c;
int prev_len = typebuf.tb_len;
curwin->w_cursor.lnum = eap->line2;
@@ -8383,11 +8384,10 @@ ex_at(eap)
/*
* Execute from the typeahead buffer.
* Originally this didn't check for the typeahead buffer to be empty,
* thus could read more Ex commands from stdin. It's not clear why,
* it is certainly unexpected.
* Continue until the stuff buffer is empty and all added characters
* have been consumed.
*/
while ((!stuff_empty() || typebuf.tb_len > 0) && vpeekc() == ':')
while (!stuff_empty() || typebuf.tb_len > prev_len)
(void)do_cmdline(NULL, getexline, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE);
exec_from_reg = save_efr;

View File

@@ -844,10 +844,14 @@
/* #define DEBUG */
/*
* STARTUPTIME Time the startup process. Writes a "vimstartup" file
* with timestamps.
* STARTUPTIME Time the startup process. Writes a file with
* 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.

View File

@@ -129,7 +129,7 @@ static void map_free __ARGS((mapblock_T **));
static void validate_maphash __ARGS((void));
static void showmap __ARGS((mapblock_T *mp, int local));
#ifdef FEAT_EVAL
static char_u *eval_map_expr __ARGS((char_u *str));
static char_u *eval_map_expr __ARGS((char_u *str, int c));
#endif
/*
@@ -2446,7 +2446,7 @@ vgetorpeek(advance)
if (tabuf.typebuf_valid)
{
vgetc_busy = 0;
s = eval_map_expr(mp->m_str);
s = eval_map_expr(mp->m_str, NUL);
vgetc_busy = save_vgetc_busy;
}
else
@@ -4367,9 +4367,9 @@ check_abbr(c, ptr, col, mincol)
* abbreviation, but is not inserted into the input stream.
*/
j = 0;
/* special key code, split up */
if (c != Ctrl_RSB)
{
/* special key code, split up */
if (IS_SPECIAL(c) || c == K_SPECIAL)
{
tb[j++] = K_SPECIAL;
@@ -4398,7 +4398,7 @@ check_abbr(c, ptr, col, mincol)
}
#ifdef FEAT_EVAL
if (mp->m_expr)
s = eval_map_expr(mp->m_str);
s = eval_map_expr(mp->m_str, c);
else
#endif
s = mp->m_str;
@@ -4434,8 +4434,9 @@ check_abbr(c, ptr, col, mincol)
* special characters.
*/
static char_u *
eval_map_expr(str)
eval_map_expr(str, c)
char_u *str;
int c; /* NUL or typed character for abbreviation */
{
char_u *res;
char_u *p;
@@ -4452,6 +4453,7 @@ eval_map_expr(str)
#ifdef FEAT_EX_EXTRA
++ex_normal_lock;
#endif
set_vim_var_char(c); /* set v:char to the typed character */
save_cursor = curwin->w_cursor;
p = eval_to_string(str, NULL, FALSE);
--textlock;

View File

@@ -1567,6 +1567,10 @@ EXTERN int xsmp_icefd INIT(= -1); /* The actual connection */
/* For undo we need to know the lowest time possible. */
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
* can't do anything useful with the value. Assign to this variable to avoid

View File

@@ -10,7 +10,7 @@
/*
* (C) 2001,2005 by Marcin Dalecki <martin@dalecki.de>
*
* Implementation of dialogue functions for the Motif GUI variant.
* Implementation of dialog functions for the Motif GUI variant.
*
* Note about Lesstif: Apparently lesstif doesn't get the widget layout right,
* when using a dynamic scrollbar policy.
@@ -633,16 +633,19 @@ do_choice(Widget w,
data->sel[which] = XtNewString(sel);
else
{
XtFree(data->sel[which]);
if (!strcmp(data->sel[which], sel))
{
/* unselecting current selection */
XtFree(data->sel[which]);
data->sel[which] = NULL;
if (w)
XmListDeselectItem(w, call_data->item);
}
else
{
XtFree(data->sel[which]);
data->sel[which] = XtNewString(sel);
}
}
XtFree(sel);

View File

@@ -2058,6 +2058,7 @@ WindowSetattr(PyObject *self, char *name, PyObject *val)
{
long lnum;
long col;
long len;
if (!PyArg_Parse(val, "(ll)", &lnum, &col))
return -1;
@@ -2072,10 +2073,16 @@ WindowSetattr(PyObject *self, char *name, PyObject *val)
if (VimErrorCheck())
return -1;
/* NO CHECK ON COLUMN - SEEMS NOT TO MATTER */
/* When column is out of range silently correct it. */
len = STRLEN(ml_get_buf(this->win->w_buffer, lnum, FALSE));
if (col > len)
col = len;
this->win->w_cursor.lnum = lnum;
this->win->w_cursor.col = col;
#ifdef FEAT_VIRTUALEDIT
this->win->w_cursor.coladd = 0;
#endif
update_screen(VALID);
return 0;

View File

@@ -243,7 +243,7 @@
#endif
#ifdef STARTUPTIME
# define TIME_MSG(s) time_msg(s, NULL)
# define TIME_MSG(s) { if (time_fd != NULL) time_msg(s, NULL); }
#else
# define TIME_MSG(s)
#endif

View File

@@ -130,10 +130,6 @@ static char_u *serverMakeName __ARGS((char_u *arg, char *cmd));
#endif
#ifdef STARTUPTIME
static FILE *time_fd = NULL;
#endif
/*
* Different types of error messages.
*/
@@ -173,6 +169,9 @@ main
char_u *fname = NULL; /* file name from command line */
mparm_T params; /* various parameters passed between
* main() and other functions. */
#ifdef STARTUPTIME
int i;
#endif
/*
* Do any system-specific initialisations. These can NOT use IObuff or
@@ -203,8 +202,15 @@ main
#endif
#ifdef STARTUPTIME
time_fd = mch_fopen(STARTUPTIME, "a");
TIME_MSG("--- VIM STARTING ---");
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 ---");
break;
}
}
#endif
starttime = time(NULL);
@@ -1150,6 +1156,18 @@ main_loop(cmdwin, noexmode)
cursor_on();
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
if (need_mouse_correct)
@@ -1743,6 +1761,10 @@ command_line_scan(parmp)
/* already processed, skip */
}
#endif
else if (STRNICMP(argv[0] + argv_idx, "startuptime", 11) == 0)
{
/* already processed, skip */
}
else
{
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;
# 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.
* 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
#if defined(FEAT_CLIENTSERVER) || defined(PROTO)

View File

@@ -864,21 +864,24 @@ ml_recover()
recoverymode = TRUE;
called_from_main = (curbuf->b_ml.ml_mfp == NULL);
attr = hl_attr(HLF_E);
/*
* If the file name ends in ".sw?" we use it directly.
* Otherwise a search is done to find the swap file(s).
*/
/*
* If the file name ends in ".s[uvw][a-z]" we assume this is the swap file.
* Otherwise a search is done to find the swap file(s).
*/
fname = curbuf->b_fname;
if (fname == NULL) /* When there is no file name */
fname = (char_u *)"";
len = (int)STRLEN(fname);
if (len >= 4 &&
#if defined(VMS) || defined(RISCOS)
STRNICMP(fname + len - 4, "_sw" , 3)
STRNICMP(fname + len - 4, "_s" , 2)
#else
STRNICMP(fname + len - 4, ".sw" , 3)
STRNICMP(fname + len - 4, ".s" , 2)
#endif
== 0)
== 0
&& vim_strchr((char_u *)"UVWuvw", fname[len - 2]) != NULL
&& ASCII_ISALPHA(fname[len - 1]))
{
directly = TRUE;
fname = vim_strsave(fname); /* make a copy for mf_open() */

View File

@@ -4473,11 +4473,6 @@ fex_format(lnum, count, c)
int use_sandbox = was_set_insecurely((char_u *)"formatexpr",
OPT_LOCAL);
int r;
#ifdef FEAT_MBYTE
char_u buf[MB_MAXBYTES];
#else
char_u buf[2];
#endif
/*
* Set v:lnum to the first line number and v:count to the number of lines.
@@ -4485,17 +4480,7 @@ fex_format(lnum, count, c)
*/
set_vim_var_nr(VV_LNUM, lnum);
set_vim_var_nr(VV_COUNT, count);
#ifdef FEAT_MBYTE
if (has_mbyte)
buf[(*mb_char2bytes)(c, buf)] = NUL;
else
#endif
{
buf[0] = c;
buf[1] = NUL;
}
set_vim_var_string(VV_CHAR, buf, -1);
set_vim_var_char(c);
/*
* Evaluate the function.

View File

@@ -61,6 +61,7 @@ void set_vim_var_nr __ARGS((int idx, long val));
long get_vim_var_nr __ARGS((int idx));
char_u *get_vim_var_str __ARGS((int idx));
list_T *get_vim_var_list __ARGS((int idx));
void set_vim_var_char __ARGS((int c));
void set_vcount __ARGS((long count, long count1, int set_prevcount));
void set_vim_var_string __ARGS((int idx, char_u *val, int len));
void set_vim_var_list __ARGS((int idx, list_T *val));

View File

@@ -676,6 +676,20 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
272,
/**/
271,
/**/
270,
/**/
269,
/**/
268,
/**/
267,
/**/
266,
/**/
265,
/**/