1
0
forked from aniani/vim

updated for version 7.0195

This commit is contained in:
Bram Moolenaar
2006-02-09 23:53:20 +00:00
parent cf0c554e3f
commit 754b56089f
8 changed files with 147 additions and 73 deletions

View File

@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 01 *autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 09
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -278,6 +278,9 @@ Name triggered by ~
|FocusGained| Vim got input focus |FocusGained| Vim got input focus
|FocusLost| Vim lost input focus |FocusLost| Vim lost input focus
|CursorHold| the user doesn't press a key for a while |CursorHold| the user doesn't press a key for a while
|CursorHoldI| the user doesn't press a key for a while in Insert mode
|CursorMoved| the cursor was moved in Normal mode
|CursorMovedI| the cursor was moved in Insert mode
|WinEnter| after entering another window |WinEnter| after entering another window
|WinLeave| before leaving a window |WinLeave| before leaving a window
@@ -440,6 +443,7 @@ CmdwinLeave Before leaving the command-line window.
|cmdwin-char| |cmdwin-char|
*ColorScheme* *ColorScheme*
ColorScheme After loading a color scheme. |:colorscheme| ColorScheme After loading a color scheme. |:colorscheme|
*CursorHold* *CursorHold*
CursorHold When the user doesn't press a key for the time CursorHold When the user doesn't press a key for the time
specified with 'updatetime'. Not re-triggered specified with 'updatetime'. Not re-triggered
@@ -460,6 +464,18 @@ CursorHold When the user doesn't press a key for the time
:let &ro = &ro :let &ro = &ro
< {only on Amiga, Unix, Win32, MSDOS and all GUI < {only on Amiga, Unix, Win32, MSDOS and all GUI
versions} versions}
*CursorHoldI*
CursorHoldI Just like CursorHold, but in Insert mode.
*CursorMoved*
CursorMoved After the cursor was moved in Normal mode.
Not triggered when there is typeahead or when
an operator is pending.
Careful: Don't do anything that the user does
not expect or that is slow.
*CursorMovedI*
CursorMovedI After the cursor was moved in Insert mode.
Otherwise the same as CursorMoved.
*EncodingChanged* *EncodingChanged*
EncodingChanged Fires off after the 'encoding' option has been EncodingChanged Fires off after the 'encoding' option has been
changed. Useful to set up fonts, for example. changed. Useful to set up fonts, for example.

View File

@@ -149,7 +149,7 @@ static int quote_meta __ARGS((char_u *dest, char_u *str, int len));
#define BACKSPACE_WORD_NOT_SPACE 3 #define BACKSPACE_WORD_NOT_SPACE 3
#define BACKSPACE_LINE 4 #define BACKSPACE_LINE 4
static void ins_redraw __ARGS((void)); static void ins_redraw __ARGS((int ready));
static void ins_ctrl_v __ARGS((void)); static void ins_ctrl_v __ARGS((void));
static void undisplay_dollar __ARGS((void)); static void undisplay_dollar __ARGS((void));
static void insert_special __ARGS((int, int, int)); static void insert_special __ARGS((int, int, int));
@@ -650,7 +650,7 @@ edit(cmdchar, startln, count)
* Redraw the display when no characters are waiting. * Redraw the display when no characters are waiting.
* Also shows mode, ruler and positions cursor. * Also shows mode, ruler and positions cursor.
*/ */
ins_redraw(); ins_redraw(TRUE);
#ifdef FEAT_SCROLLBIND #ifdef FEAT_SCROLLBIND
if (curwin->w_p_scb) if (curwin->w_p_scb)
@@ -732,7 +732,7 @@ edit(cmdchar, startln, count)
if (c == Ctrl_BSL) if (c == Ctrl_BSL)
{ {
/* may need to redraw when no more chars available now */ /* may need to redraw when no more chars available now */
ins_redraw(); ins_redraw(FALSE);
++no_mapping; ++no_mapping;
++allow_keys; ++allow_keys;
c = safe_vgetc(); c = safe_vgetc();
@@ -1038,6 +1038,13 @@ doESCkey:
case K_IGNORE: /* Something mapped to nothing */ case K_IGNORE: /* Something mapped to nothing */
break; break;
#ifdef FEAT_AUTOCMD
case K_CURSORHOLD: /* Didn't type something for a while. */
apply_autocmds(EVENT_CURSORHOLDI, NULL, NULL, FALSE, curbuf);
did_cursorhold = TRUE;
break;
#endif
#ifdef FEAT_GUI_W32 #ifdef FEAT_GUI_W32
/* On Win32 ignore <M-F4>, we get it when closing the window was /* On Win32 ignore <M-F4>, we get it when closing the window was
* cancelled. */ * cancelled. */
@@ -1345,11 +1352,22 @@ force_cindent:
* Only redraw when there are no characters available. This speeds up * Only redraw when there are no characters available. This speeds up
* inserting sequences of characters (e.g., for CTRL-R). * inserting sequences of characters (e.g., for CTRL-R).
*/ */
/*ARGSUSED*/
static void static void
ins_redraw() ins_redraw(ready)
int ready; /* not busy with something */
{ {
if (!char_avail()) if (!char_avail())
{ {
#ifdef FEAT_AUTOCMD
/* Trigger CursorMoved if the cursor moved. */
if (ready && has_cursormovedI()
&& !equalpos(last_cursormoved, curwin->w_cursor))
{
apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf);
last_cursormoved = curwin->w_cursor;
}
#endif
if (must_redraw) if (must_redraw)
update_screen(0); update_screen(0);
else if (clear_cmdline || redraw_cmdline) else if (clear_cmdline || redraw_cmdline)
@@ -1369,7 +1387,7 @@ ins_ctrl_v()
int c; int c;
/* may need to redraw when no more chars available now */ /* may need to redraw when no more chars available now */
ins_redraw(); ins_redraw(FALSE);
if (redrawing() && !char_avail()) if (redrawing() && !char_avail())
edit_putchar('^', TRUE); edit_putchar('^', TRUE);
@@ -6652,7 +6670,7 @@ ins_reg()
if (redrawing() && !char_avail()) if (redrawing() && !char_avail())
{ {
/* may need to redraw when no more chars available now */ /* may need to redraw when no more chars available now */
ins_redraw(); ins_redraw(FALSE);
edit_putchar('"', TRUE); edit_putchar('"', TRUE);
#ifdef FEAT_CMDL_INFO #ifdef FEAT_CMDL_INFO
@@ -8324,7 +8342,7 @@ ins_digraph()
if (redrawing() && !char_avail()) if (redrawing() && !char_avail())
{ {
/* may need to redraw when no more chars available now */ /* may need to redraw when no more chars available now */
ins_redraw(); ins_redraw(FALSE);
edit_putchar('?', TRUE); edit_putchar('?', TRUE);
#ifdef FEAT_CMDL_INFO #ifdef FEAT_CMDL_INFO
@@ -8356,14 +8374,14 @@ ins_digraph()
if (redrawing() && !char_avail()) if (redrawing() && !char_avail())
{ {
/* may need to redraw when no more chars available now */ /* may need to redraw when no more chars available now */
ins_redraw(); ins_redraw(FALSE);
if (char2cells(c) == 1) if (char2cells(c) == 1)
{ {
/* first remove the '?', otherwise it's restored when typing /* first remove the '?', otherwise it's restored when typing
* an ESC next */ * an ESC next */
edit_unputchar(); edit_unputchar();
ins_redraw(); ins_redraw(FALSE);
edit_putchar(c, TRUE); edit_putchar(c, TRUE);
} }
#ifdef FEAT_CMDL_INFO #ifdef FEAT_CMDL_INFO

View File

@@ -65,7 +65,7 @@ static void msg_add_eol __ARGS((void));
static int check_mtime __ARGS((buf_T *buf, struct stat *s)); static int check_mtime __ARGS((buf_T *buf, struct stat *s));
static int time_differs __ARGS((long t1, long t2)); static int time_differs __ARGS((long t1, long t2));
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
static int apply_autocmds_exarg __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap)); static int apply_autocmds_exarg __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap));
#endif #endif
#if defined(FEAT_CRYPT) || defined(FEAT_MBYTE) #if defined(FEAT_CRYPT) || defined(FEAT_MBYTE)
@@ -6894,7 +6894,7 @@ typedef struct AutoPat
static struct event_name static struct event_name
{ {
char *name; /* event name */ char *name; /* event name */
EVENT_T event; /* event number */ event_T event; /* event number */
} event_names[] = } event_names[] =
{ {
{"BufAdd", EVENT_BUFADD}, {"BufAdd", EVENT_BUFADD},
@@ -6922,9 +6922,12 @@ static struct event_name
{"CmdwinEnter", EVENT_CMDWINENTER}, {"CmdwinEnter", EVENT_CMDWINENTER},
{"CmdwinLeave", EVENT_CMDWINLEAVE}, {"CmdwinLeave", EVENT_CMDWINLEAVE},
{"ColorScheme", EVENT_COLORSCHEME}, {"ColorScheme", EVENT_COLORSCHEME},
{"CursorHold", EVENT_CURSORHOLD},
{"CursorHoldI", EVENT_CURSORHOLDI},
{"CursorMoved", EVENT_CURSORMOVED},
{"CursorMovedI", EVENT_CURSORMOVEDI},
{"EncodingChanged", EVENT_ENCODINGCHANGED}, {"EncodingChanged", EVENT_ENCODINGCHANGED},
{"FileEncoding", EVENT_ENCODINGCHANGED}, {"FileEncoding", EVENT_ENCODINGCHANGED},
{"CursorHold", EVENT_CURSORHOLD},
{"FileAppendPost", EVENT_FILEAPPENDPOST}, {"FileAppendPost", EVENT_FILEAPPENDPOST},
{"FileAppendPre", EVENT_FILEAPPENDPRE}, {"FileAppendPre", EVENT_FILEAPPENDPRE},
{"FileAppendCmd", EVENT_FILEAPPENDCMD}, {"FileAppendCmd", EVENT_FILEAPPENDCMD},
@@ -6966,7 +6969,7 @@ static struct event_name
{"VimLeavePre", EVENT_VIMLEAVEPRE}, {"VimLeavePre", EVENT_VIMLEAVEPRE},
{"WinEnter", EVENT_WINENTER}, {"WinEnter", EVENT_WINENTER},
{"WinLeave", EVENT_WINLEAVE}, {"WinLeave", EVENT_WINLEAVE},
{NULL, (EVENT_T)0} {NULL, (event_T)0}
}; };
static AutoPat *first_autopat[NUM_EVENTS] = static AutoPat *first_autopat[NUM_EVENTS] =
@@ -6990,7 +6993,7 @@ typedef struct AutoPatCmd
char_u *fname; /* fname to match with */ char_u *fname; /* fname to match with */
char_u *sfname; /* sfname to match with */ char_u *sfname; /* sfname to match with */
char_u *tail; /* tail of fname */ char_u *tail; /* tail of fname */
EVENT_T event; /* current event */ event_T event; /* current event */
int arg_bufnr; /* initially equal to <abuf>, set to zero when int arg_bufnr; /* initially equal to <abuf>, set to zero when
buf is deleted */ buf is deleted */
struct AutoPatCmd *next; /* chain of active apc-s for auto-invalidation*/ struct AutoPatCmd *next; /* chain of active apc-s for auto-invalidation*/
@@ -7014,25 +7017,25 @@ static int current_augroup = AUGROUP_DEFAULT;
static int au_need_clean = FALSE; /* need to delete marked patterns */ static int au_need_clean = FALSE; /* need to delete marked patterns */
static void show_autocmd __ARGS((AutoPat *ap, EVENT_T event)); static void show_autocmd __ARGS((AutoPat *ap, event_T event));
static void au_remove_pat __ARGS((AutoPat *ap)); static void au_remove_pat __ARGS((AutoPat *ap));
static void au_remove_cmds __ARGS((AutoPat *ap)); static void au_remove_cmds __ARGS((AutoPat *ap));
static void au_cleanup __ARGS((void)); static void au_cleanup __ARGS((void));
static int au_new_group __ARGS((char_u *name)); static int au_new_group __ARGS((char_u *name));
static void au_del_group __ARGS((char_u *name)); static void au_del_group __ARGS((char_u *name));
static int au_find_group __ARGS((char_u *name)); static int au_find_group __ARGS((char_u *name));
static EVENT_T event_name2nr __ARGS((char_u *start, char_u **end)); static event_T event_name2nr __ARGS((char_u *start, char_u **end));
static char_u *event_nr2name __ARGS((EVENT_T event)); static char_u *event_nr2name __ARGS((event_T event));
static char_u *find_end_event __ARGS((char_u *arg, int have_group)); static char_u *find_end_event __ARGS((char_u *arg, int have_group));
static int event_ignored __ARGS((EVENT_T event)); static int event_ignored __ARGS((event_T event));
static int au_get_grouparg __ARGS((char_u **argp)); static int au_get_grouparg __ARGS((char_u **argp));
static int do_autocmd_event __ARGS((EVENT_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group)); static int do_autocmd_event __ARGS((event_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
static char_u *getnextac __ARGS((int c, void *cookie, int indent)); static char_u *getnextac __ARGS((int c, void *cookie, int indent));
static int apply_autocmds_group __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap)); static int apply_autocmds_group __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap));
static void auto_next_pat __ARGS((AutoPatCmd *apc, int stop_at_last)); static void auto_next_pat __ARGS((AutoPatCmd *apc, int stop_at_last));
static EVENT_T last_event; static event_T last_event;
static int last_group; static int last_group;
/* /*
@@ -7041,7 +7044,7 @@ static int last_group;
static void static void
show_autocmd(ap, event) show_autocmd(ap, event)
AutoPat *ap; AutoPat *ap;
EVENT_T event; event_T event;
{ {
AutoCmd *ac; AutoCmd *ac;
@@ -7140,14 +7143,14 @@ au_cleanup()
{ {
AutoPat *ap, **prev_ap; AutoPat *ap, **prev_ap;
AutoCmd *ac, **prev_ac; AutoCmd *ac, **prev_ac;
EVENT_T event; event_T event;
if (autocmd_busy || !au_need_clean) if (autocmd_busy || !au_need_clean)
return; return;
/* loop over all events */ /* loop over all events */
for (event = (EVENT_T)0; (int)event < (int)NUM_EVENTS; for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
event = (EVENT_T)((int)event + 1)) event = (event_T)((int)event + 1))
{ {
/* loop over all autocommand patterns */ /* loop over all autocommand patterns */
prev_ap = &(first_autopat[(int)event]); prev_ap = &(first_autopat[(int)event]);
@@ -7193,7 +7196,7 @@ aubuflocal_remove(buf)
buf_T *buf; buf_T *buf;
{ {
AutoPat *ap; AutoPat *ap;
EVENT_T event; event_T event;
AutoPatCmd *apc; AutoPatCmd *apc;
/* invalidate currently executing autocommands */ /* invalidate currently executing autocommands */
@@ -7202,8 +7205,8 @@ aubuflocal_remove(buf)
apc->arg_bufnr = 0; apc->arg_bufnr = 0;
/* invalidate buflocals looping through events */ /* invalidate buflocals looping through events */
for (event = (EVENT_T)0; (int)event < (int)NUM_EVENTS; for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
event = (EVENT_T)((int)event + 1)) event = (event_T)((int)event + 1))
/* loop over all autocommand patterns */ /* loop over all autocommand patterns */
for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next) for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
if (ap->buflocal_nr == buf->b_fnum) if (ap->buflocal_nr == buf->b_fnum)
@@ -7352,7 +7355,7 @@ free_all_autocmds()
* Return NUM_EVENTS if the event name was not found. * Return NUM_EVENTS if the event name was not found.
* Return a pointer to the next event name in "end". * Return a pointer to the next event name in "end".
*/ */
static EVENT_T static event_T
event_name2nr(start, end) event_name2nr(start, end)
char_u *start; char_u *start;
char_u **end; char_u **end;
@@ -7383,7 +7386,7 @@ event_name2nr(start, end)
*/ */
static char_u * static char_u *
event_nr2name(event) event_nr2name(event)
EVENT_T event; event_T event;
{ {
int i; int i;
@@ -7435,7 +7438,7 @@ find_end_event(arg, have_group)
*/ */
static int static int
event_ignored(event) event_ignored(event)
EVENT_T event; event_T event;
{ {
char_u *p = p_ei; char_u *p = p_ei;
@@ -7547,7 +7550,7 @@ do_autocmd(arg, forceit)
char_u *pat; char_u *pat;
char_u *envpat = NULL; char_u *envpat = NULL;
char_u *cmd; char_u *cmd;
EVENT_T event; event_T event;
int need_free = FALSE; int need_free = FALSE;
int nested = FALSE; int nested = FALSE;
int group; int group;
@@ -7628,12 +7631,12 @@ do_autocmd(arg, forceit)
/* /*
* Loop over the events. * Loop over the events.
*/ */
last_event = (EVENT_T)-1; /* for listing the event name */ last_event = (event_T)-1; /* for listing the event name */
last_group = AUGROUP_ERROR; /* for listing the group name */ last_group = AUGROUP_ERROR; /* for listing the group name */
if (*arg == '*' || *arg == NUL) if (*arg == '*' || *arg == NUL)
{ {
for (event = (EVENT_T)0; (int)event < (int)NUM_EVENTS; for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
event = (EVENT_T)((int)event + 1)) event = (event_T)((int)event + 1))
if (do_autocmd_event(event, pat, if (do_autocmd_event(event, pat,
nested, cmd, forceit, group) == FAIL) nested, cmd, forceit, group) == FAIL)
break; break;
@@ -7691,7 +7694,7 @@ au_get_grouparg(argp)
*/ */
static int static int
do_autocmd_event(event, pat, nested, cmd, forceit, group) do_autocmd_event(event, pat, nested, cmd, forceit, group)
EVENT_T event; event_T event;
char_u *pat; char_u *pat;
int nested; int nested;
char_u *cmd; char_u *cmd;
@@ -8162,7 +8165,7 @@ static int autocmd_nested = FALSE;
*/ */
int int
apply_autocmds(event, fname, fname_io, force, buf) apply_autocmds(event, fname, fname_io, force, buf)
EVENT_T event; event_T event;
char_u *fname; /* NULL or empty means use actual file name */ char_u *fname; /* NULL or empty means use actual file name */
char_u *fname_io; /* fname to use for <afile> on cmdline */ char_u *fname_io; /* fname to use for <afile> on cmdline */
int force; /* when TRUE, ignore autocmd_busy */ int force; /* when TRUE, ignore autocmd_busy */
@@ -8178,7 +8181,7 @@ apply_autocmds(event, fname, fname_io, force, buf)
*/ */
static int static int
apply_autocmds_exarg(event, fname, fname_io, force, buf, eap) apply_autocmds_exarg(event, fname, fname_io, force, buf, eap)
EVENT_T event; event_T event;
char_u *fname; char_u *fname;
char_u *fname_io; char_u *fname_io;
int force; int force;
@@ -8197,7 +8200,7 @@ apply_autocmds_exarg(event, fname, fname_io, force, buf, eap)
*/ */
int int
apply_autocmds_retval(event, fname, fname_io, force, buf, retval) apply_autocmds_retval(event, fname, fname_io, force, buf, retval)
EVENT_T event; event_T event;
char_u *fname; /* NULL or empty means use actual file name */ char_u *fname; /* NULL or empty means use actual file name */
char_u *fname_io; /* fname to use for <afile> on cmdline */ char_u *fname_io; /* fname to use for <afile> on cmdline */
int force; /* when TRUE, ignore autocmd_busy */ int force; /* when TRUE, ignore autocmd_busy */
@@ -8222,14 +8225,14 @@ apply_autocmds_retval(event, fname, fname_io, force, buf, retval)
return did_cmd; return did_cmd;
} }
#if defined(FEAT_AUTOCMD) || defined(PROTO)
/* /*
* Return TRUE when there is a CursorHold autocommand defined. * Return TRUE when there is a CursorHold autocommand defined.
*/ */
int int
has_cursorhold() has_cursorhold()
{ {
return (first_autopat[(int)EVENT_CURSORHOLD] != NULL); return (first_autopat[(int)(get_real_state() == NORMAL_BUSY
? EVENT_CURSORHOLD : EVENT_CURSORHOLDI)] != NULL);
} }
/* /*
@@ -8238,16 +8241,38 @@ has_cursorhold()
int int
trigger_cursorhold() trigger_cursorhold()
{ {
return (!did_cursorhold int state;
&& has_cursorhold()
&& !Recording if (!did_cursorhold && has_cursorhold() && !Recording)
&& get_real_state() == NORMAL_BUSY); {
state = get_real_state();
if (state == NORMAL_BUSY || (state & INSERT) != 0)
return TRUE;
}
return FALSE;
}
/*
* Return TRUE when there is a CursorMoved autocommand defined.
*/
int
has_cursormoved()
{
return (first_autopat[(int)EVENT_CURSORMOVED] != NULL);
}
/*
* Return TRUE when there is a CursorMovedI autocommand defined.
*/
int
has_cursormovedI()
{
return (first_autopat[(int)EVENT_CURSORMOVEDI] != NULL);
} }
#endif
static int static int
apply_autocmds_group(event, fname, fname_io, force, group, buf, eap) apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
EVENT_T event; event_T event;
char_u *fname; /* NULL or empty means use actual file name */ char_u *fname; /* NULL or empty means use actual file name */
char_u *fname_io; /* fname to use for <afile> on cmdline, NULL means char_u *fname_io; /* fname to use for <afile> on cmdline, NULL means
use fname */ use fname */
@@ -8735,7 +8760,7 @@ getnextac(c, cookie, indent)
*/ */
int int
has_autocmd(event, sfname, buf) has_autocmd(event, sfname, buf)
EVENT_T event; event_T event;
char_u *sfname; char_u *sfname;
buf_T *buf; buf_T *buf;
{ {
@@ -8902,7 +8927,7 @@ au_exists(arg)
char_u *pattern = NULL; char_u *pattern = NULL;
char_u *event_name; char_u *event_name;
char_u *p; char_u *p;
EVENT_T event; event_T event;
AutoPat *ap; AutoPat *ap;
buf_T *buflocal_buf = NULL; buf_T *buflocal_buf = NULL;
int group; int group;

View File

@@ -781,8 +781,10 @@ EXTERN int xim_changed_while_preediting INIT(= FALSE);
# else # else
EXTERN XIC xic INIT(= NULL); EXTERN XIC xic INIT(= NULL);
# endif # endif
# ifdef FEAT_GUI
EXTERN guicolor_T xim_fg_color INIT(= INVALCOLOR); EXTERN guicolor_T xim_fg_color INIT(= INVALCOLOR);
EXTERN guicolor_T xim_bg_color INIT(= INVALCOLOR); EXTERN guicolor_T xim_bg_color INIT(= INVALCOLOR);
# endif
#endif #endif
#ifdef FEAT_HANGULIN #ifdef FEAT_HANGULIN
@@ -952,7 +954,12 @@ EXTERN char_u *new_last_cmdline INIT(= NULL); /* new value for last_cmdline */
EXTERN char_u *autocmd_fname INIT(= NULL); /* fname for <afile> on cmdline */ EXTERN char_u *autocmd_fname INIT(= NULL); /* fname for <afile> on cmdline */
EXTERN int autocmd_bufnr INIT(= 0); /* fnum for <abuf> on cmdline */ EXTERN int autocmd_bufnr INIT(= 0); /* fnum for <abuf> on cmdline */
EXTERN char_u *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */ EXTERN char_u *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */
EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold triggered */ EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */
EXTERN pos_T last_cursormoved /* for CursorMoved event */
# ifdef DO_INIT
= INIT_POS_T
# endif
;
#endif #endif
EXTERN linenr_T write_no_eol_lnum INIT(= 0); /* non-zero lnum when last line EXTERN linenr_T write_no_eol_lnum INIT(= 0); /* non-zero lnum when last line

View File

@@ -100,7 +100,7 @@
#include <X11/Xlocale.h> #include <X11/Xlocale.h>
#endif #endif
#if defined(FEAT_XIM) && defined(HAVE_GTK2) #if defined(FEAT_GUI_GTK) && defined(FEAT_XIM) && defined(HAVE_GTK2)
# include <gdk/gdkkeysyms.h> # include <gdk/gdkkeysyms.h>
# ifdef WIN3264 # ifdef WIN3264
# include <gdk/gdkwin32.h> # include <gdk/gdkwin32.h>

View File

@@ -33,11 +33,13 @@ int do_doautocmd __ARGS((char_u *arg, int do_msg));
void ex_doautoall __ARGS((exarg_T *eap)); void ex_doautoall __ARGS((exarg_T *eap));
void aucmd_prepbuf __ARGS((aco_save_T *aco, buf_T *buf)); void aucmd_prepbuf __ARGS((aco_save_T *aco, buf_T *buf));
void aucmd_restbuf __ARGS((aco_save_T *aco)); void aucmd_restbuf __ARGS((aco_save_T *aco));
int apply_autocmds __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf)); int apply_autocmds __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf));
int apply_autocmds_retval __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, int *retval)); int apply_autocmds_retval __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, int *retval));
int has_cursorhold __ARGS((void)); int has_cursorhold __ARGS((void));
int trigger_cursorhold __ARGS((void)); int trigger_cursorhold __ARGS((void));
int has_autocmd __ARGS((EVENT_T event, char_u *sfname, buf_T *buf)); int has_cursormoved __ARGS((void));
int has_cursormovedI __ARGS((void));
int has_autocmd __ARGS((event_T event, char_u *sfname, buf_T *buf));
char_u *get_augroup_name __ARGS((expand_T *xp, int idx)); char_u *get_augroup_name __ARGS((expand_T *xp, int idx));
char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd)); char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd));
char_u *get_event_name __ARGS((expand_T *xp, int idx)); char_u *get_event_name __ARGS((expand_T *xp, int idx));

View File

@@ -2575,8 +2575,10 @@ buf_hide(buf)
grep_internal(cmdidx) grep_internal(cmdidx)
cmdidx_T cmdidx; cmdidx_T cmdidx;
{ {
return ((cmdidx == CMD_grep || cmdidx == CMD_lgrep return ((cmdidx == CMD_grep
|| cmdidx == CMD_grepadd || cmdidx == CMD_lgrepadd) || cmdidx == CMD_lgrep
|| cmdidx == CMD_grepadd
|| cmdidx == CMD_lgrepadd)
&& STRCMP("internal", && STRCMP("internal",
*curbuf->b_p_gp == NUL ? p_gp : curbuf->b_p_gp) == 0); *curbuf->b_p_gp == NUL ? p_gp : curbuf->b_p_gp) == 0);
} }
@@ -2598,12 +2600,12 @@ ex_make(eap)
switch (eap->cmdidx) switch (eap->cmdidx)
{ {
case CMD_make: au_name = (char_u *)"make"; break; case CMD_make: au_name = (char_u *)"make"; break;
case CMD_lmake: au_name = (char_u *)"lmake"; break; case CMD_lmake: au_name = (char_u *)"lmake"; break;
case CMD_grep: au_name = (char_u *)"grep"; break; case CMD_grep: au_name = (char_u *)"grep"; break;
case CMD_lgrep: au_name = (char_u *)"lgrep"; break; case CMD_lgrep: au_name = (char_u *)"lgrep"; break;
case CMD_grepadd: au_name = (char_u *)"grepadd"; break; case CMD_grepadd: au_name = (char_u *)"grepadd"; break;
case CMD_lgrepadd: au_name = (char_u *)"lgrepadd"; break; case CMD_lgrepadd: au_name = (char_u *)"lgrepadd"; break;
default: break; default: break;
} }
if (au_name != NULL) if (au_name != NULL)
@@ -2908,7 +2910,7 @@ ex_vimgrep(eap)
} }
#endif #endif
if (eap->cmdidx == CMD_grep if (eap->cmdidx == CMD_lgrep
|| eap->cmdidx == CMD_lvimgrep || eap->cmdidx == CMD_lvimgrep
|| eap->cmdidx == CMD_lgrepadd || eap->cmdidx == CMD_lgrepadd
|| eap->cmdidx == CMD_lvimgrepadd) || eap->cmdidx == CMD_lvimgrepadd)
@@ -2939,7 +2941,7 @@ ex_vimgrep(eap)
goto theend; goto theend;
} }
if ((eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_lgrepadd && if ((eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_lgrepadd &&
eap->cmdidx != CMD_vimgrepadd && eap->cmdidx != CMD_lvimgrepadd) eap->cmdidx != CMD_vimgrepadd && eap->cmdidx != CMD_lvimgrepadd)
|| qi->qf_curlist == qi->qf_listcount) || qi->qf_curlist == qi->qf_listcount)
/* make place for a new list */ /* make place for a new list */
@@ -3476,10 +3478,15 @@ ex_cbuffer(eap)
|| eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count) || eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count)
EMSG(_(e_invrange)); EMSG(_(e_invrange));
else else
qf_init_ext(qi, NULL, buf, NULL, p_efm, {
(eap->cmdidx == CMD_cbuffer int buffer_cmd = (eap->cmdidx == CMD_cbuffer
|| eap->cmdidx == CMD_lbuffer), || eap->cmdidx == CMD_lbuffer);
eap->line1, eap->line2);
if (qf_init_ext(qi, NULL, buf, NULL, p_efm, buffer_cmd,
eap->line1, eap->line2) > 0
&& buffer_cmd)
qf_jump(qi, 0, 0, eap->forceit); /* display first error */
}
} }
} }
@@ -3673,8 +3680,7 @@ ex_helpgrep(eap)
if (eap->cmdidx == CMD_lhelpgrep) if (eap->cmdidx == CMD_lhelpgrep)
{ {
/* If the help window is not opened or if it already points to the /* If the help window is not opened or if it already points to the
* correct location list, then free the new location list * correct location list, then free the new location list. */
*/
if (!curwin->w_buffer->b_help || curwin->w_llist == qi) if (!curwin->w_buffer->b_help || curwin->w_llist == qi)
{ {
if (new_qi) if (new_qi)

View File

@@ -36,5 +36,5 @@
#define VIM_VERSION_NODOT "vim70aa" #define VIM_VERSION_NODOT "vim70aa"
#define VIM_VERSION_SHORT "7.0aa" #define VIM_VERSION_SHORT "7.0aa"
#define VIM_VERSION_MEDIUM "7.0aa ALPHA" #define VIM_VERSION_MEDIUM "7.0aa ALPHA"
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 7)" #define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 9)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 7, compiled " #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 9, compiled "