summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-03-21 21:29:36 +0000
committerBram Moolenaar <Bram@vim.org>2006-03-21 21:29:36 +0000
commit433f7c88d56bb8fd99082314055305a656462a13 (patch)
tree5e23837d28ffd97fa77f99e4dea346d087e5f323 /src
parent76916e60ed6296aff1b855408b81cc08b8e07257 (diff)
updated for version 7.0231
Diffstat (limited to 'src')
-rw-r--r--src/edit.c14
-rw-r--r--src/ex_cmds2.c91
-rw-r--r--src/misc2.c9
-rw-r--r--src/undo.c25
-rw-r--r--src/version.h4
5 files changed, 84 insertions, 59 deletions
diff --git a/src/edit.c b/src/edit.c
index 898f9235e1..c22bb39ef5 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -1390,9 +1390,14 @@ ins_redraw(ready)
if (!char_avail())
{
#ifdef FEAT_AUTOCMD
- /* Trigger CursorMoved if the cursor moved. */
+ /* Trigger CursorMoved if the cursor moved. Not when the popup menu is
+ * visible, the command might delete it. */
if (ready && has_cursormovedI()
- && !equalpos(last_cursormoved, curwin->w_cursor))
+ && !equalpos(last_cursormoved, curwin->w_cursor)
+# ifdef FEAT_INS_EXPAND
+ && !pum_visible()
+# endif
+ )
{
apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf);
last_cursormoved = curwin->w_cursor;
@@ -2460,6 +2465,11 @@ ins_compl_show_pum()
if (!pum_wanted() || !pum_enough_matches())
return;
+#if defined(FEAT_EVAL)
+ /* Dirty hard-coded hack: remove any matchparen highlighting. */
+ do_cmdline_cmd((char_u *)"if exists('g:loaded_matchparen')|3match none|endif");
+#endif
+
/* Update the screen before drawing the popup menu over it. */
update_screen(0);
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index c85f0b6a62..cf6d00f257 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -809,29 +809,7 @@ dbg_breakpoint(name, lnum)
}
-# if defined(FEAT_PROFILE) || defined(PROTO)
-/*
- * Functions for profiling.
- */
-static void script_do_profile __ARGS((scriptitem_T *si));
-static void script_dump_profile __ARGS((FILE *fd));
-static proftime_T prof_wait_time;
-
-/*
- * Set the time in "tm" to zero.
- */
- void
-profile_zero(tm)
- proftime_T *tm;
-{
-# ifdef WIN3264
- tm->QuadPart = 0;
-# else
- tm->tv_usec = 0;
- tm->tv_sec = 0;
-# endif
-}
-
+# if defined(FEAT_PROFILE) || defined(FEAT_RELTIME) || defined(PROTO)
/*
* Store the current time in "tm".
*/
@@ -891,6 +869,52 @@ profile_sub(tm, tm2)
}
/*
+ * Return a string that represents the time in "tm".
+ * Uses a static buffer!
+ */
+ char *
+profile_msg(tm)
+ proftime_T *tm;
+{
+ static char buf[50];
+
+# ifdef WIN3264
+ LARGE_INTEGER fr;
+
+ QueryPerformanceFrequency(&fr);
+ sprintf(buf, "%10.6lf", (double)tm->QuadPart / (double)fr.QuadPart);
+# else
+ sprintf(buf, "%3ld.%06ld", (long)tm->tv_sec, (long)tm->tv_usec);
+#endif
+ return buf;
+}
+
+# endif /* FEAT_PROFILE || FEAT_RELTIME */
+
+# if defined(FEAT_PROFILE) || defined(PROTO)
+/*
+ * Functions for profiling.
+ */
+static void script_do_profile __ARGS((scriptitem_T *si));
+static void script_dump_profile __ARGS((FILE *fd));
+static proftime_T prof_wait_time;
+
+/*
+ * Set the time in "tm" to zero.
+ */
+ void
+profile_zero(tm)
+ proftime_T *tm;
+{
+# ifdef WIN3264
+ tm->QuadPart = 0;
+# else
+ tm->tv_usec = 0;
+ tm->tv_sec = 0;
+# endif
+}
+
+/*
* Add the time "tm2" to "tm".
*/
void
@@ -985,27 +1009,6 @@ profile_cmp(tm1, tm2)
# endif
}
-/*
- * Return a string that represents a time.
- * Uses a static buffer!
- */
- char *
-profile_msg(tm)
- proftime_T *tm;
-{
- static char buf[50];
-
-# ifdef WIN3264
- LARGE_INTEGER fr;
-
- QueryPerformanceFrequency(&fr);
- sprintf(buf, "%10.6lf", (double)tm->QuadPart / (double)fr.QuadPart);
-# else
- sprintf(buf, "%3ld.%06ld", (long)tm->tv_sec, (long)tm->tv_usec);
-#endif
- return buf;
-}
-
static char_u *profile_fname = NULL;
static proftime_T pause_time;
diff --git a/src/misc2.c b/src/misc2.c
index 6a34d33b65..004974a206 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -5152,7 +5152,7 @@ find_file_in_path(ptr, len, options, first, rel_fname)
{
return find_file_in_path_option(ptr, len, options, first,
*curbuf->b_p_path == NUL ? p_path : curbuf->b_p_path,
- FALSE, rel_fname);
+ FALSE, rel_fname, curbuf->b_p_sua);
}
static char_u *ff_file_to_find = NULL;
@@ -5185,11 +5185,11 @@ find_directory_in_path(ptr, len, options, rel_fname)
char_u *rel_fname; /* file name searching relative to */
{
return find_file_in_path_option(ptr, len, options, TRUE, p_cdpath,
- TRUE, rel_fname);
+ TRUE, rel_fname, (char_u *)"");
}
char_u *
-find_file_in_path_option(ptr, len, options, first, path_option, need_dir, rel_fname)
+find_file_in_path_option(ptr, len, options, first, path_option, need_dir, rel_fname, suffixes)
char_u *ptr; /* file name */
int len; /* length of file name */
int options;
@@ -5197,6 +5197,7 @@ find_file_in_path_option(ptr, len, options, first, path_option, need_dir, rel_fn
char_u *path_option; /* p_path or p_cdpath */
int need_dir; /* looking for directory name */
char_u *rel_fname; /* file name we are looking relative to. */
+ char_u *suffixes; /* list of suffixes, 'suffixesadd' option */
{
static char_u *dir;
static int did_findfile_init = FALSE;
@@ -5289,7 +5290,7 @@ find_file_in_path_option(ptr, len, options, first, path_option, need_dir, rel_fn
/* When the file doesn't exist, try adding parts of
* 'suffixesadd'. */
- buf = curbuf->b_p_sua;
+ buf = suffixes;
for (;;)
{
if (
diff --git a/src/undo.c b/src/undo.c
index 555d9e5b19..ed106c1743 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -88,7 +88,7 @@ static int undo_allowed __ARGS((void));
static int u_savecommon __ARGS((linenr_T, linenr_T, linenr_T));
static void u_doit __ARGS((int count));
static void u_undoredo __ARGS((int undo));
-static void u_undo_end __ARGS((void));
+static void u_undo_end __ARGS((int did_undo));
static void u_add_time __ARGS((char_u *buf, size_t buflen, time_t tt));
static void u_freeheader __ARGS((buf_T *buf, u_header_T *uhp, u_header_T **uhpp));
static void u_freebranch __ARGS((buf_T *buf, u_header_T *uhp, u_header_T **uhpp));
@@ -638,7 +638,7 @@ u_doit(startcount)
curbuf->b_u_curhead = curbuf->b_u_curhead->uh_prev;
}
}
- u_undo_end();
+ u_undo_end(undo_undoes);
}
static int lastmark = 0;
@@ -669,6 +669,7 @@ undo_time(step, sec, absolute)
int round;
int dosec = sec;
int above = FALSE;
+ int did_undo = TRUE;
/* First make sure the current undoable change is synced. */
if (curbuf->b_u_synced == FALSE)
@@ -888,6 +889,7 @@ undo_time(step, sec, absolute)
if (uhp->uh_prev == NULL)
curbuf->b_u_newhead = uhp;
curbuf->b_u_curhead = uhp->uh_prev;
+ did_undo = FALSE;
if (uhp->uh_seq == target) /* found it! */
break;
@@ -901,7 +903,7 @@ undo_time(step, sec, absolute)
}
}
}
- u_undo_end();
+ u_undo_end(did_undo);
}
/*
@@ -1174,7 +1176,8 @@ u_undoredo(undo)
* in some cases, but it's better than nothing).
*/
static void
-u_undo_end()
+u_undo_end(did_undo)
+ int did_undo; /* just did an undo */
{
char *msg;
u_header_T *uhp;
@@ -1211,7 +1214,12 @@ u_undo_end()
}
if (curbuf->b_u_curhead != NULL)
- uhp = curbuf->b_u_curhead;
+ {
+ if (did_undo)
+ uhp = curbuf->b_u_curhead;
+ else
+ uhp = curbuf->b_u_curhead->uh_next;
+ }
else
uhp = curbuf->b_u_newhead;
@@ -1220,9 +1228,12 @@ u_undo_end()
else
u_add_time(msgbuf, sizeof(msgbuf), uhp->uh_time);
- smsg((char_u *)_("%ld %s; #%ld %s"),
+ smsg((char_u *)_("%ld %s; %s #%ld %s"),
u_oldcount < 0 ? -u_oldcount : u_oldcount,
- _(msg), uhp == NULL ? 0L : uhp->uh_seq, msgbuf);
+ _(msg),
+ did_undo ? _("before") : _("after"),
+ uhp == NULL ? 0L : uhp->uh_seq,
+ msgbuf);
}
/*
diff --git a/src/version.h b/src/version.h
index ee1532b8c1..6ba548ba14 100644
--- a/src/version.h
+++ b/src/version.h
@@ -36,5 +36,5 @@
#define VIM_VERSION_NODOT "vim70aa"
#define VIM_VERSION_SHORT "7.0aa"
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
-#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 20)"
-#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 20, compiled "
+#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 21)"
+#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 21, compiled "