0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.0230

This commit is contained in:
Bram Moolenaar 2006-03-20 21:50:15 +00:00
parent 371d5403d0
commit 0126585dbb
2 changed files with 37 additions and 20 deletions

View File

@ -2855,7 +2855,7 @@ call_shell(cmd, opt)
} }
#ifdef FEAT_PROFILE #ifdef FEAT_PROFILE
if (do_profiling) if (do_profiling == PROF_YES)
prof_child_enter(&wait_time); prof_child_enter(&wait_time);
#endif #endif
@ -2905,7 +2905,7 @@ call_shell(cmd, opt)
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
set_vim_var_nr(VV_SHELL_ERROR, (long)retval); set_vim_var_nr(VV_SHELL_ERROR, (long)retval);
# ifdef FEAT_PROFILE # ifdef FEAT_PROFILE
if (do_profiling) if (do_profiling == PROF_YES)
prof_child_exit(&wait_time); prof_child_exit(&wait_time);
# endif # endif
#endif #endif
@ -2914,8 +2914,8 @@ call_shell(cmd, opt)
} }
/* /*
* VISUAL and OP_PENDING State are never set, they are equal to NORMAL State * VISUAL, SELECTMODE and OP_PENDING State are never set, they are equal to
* with a condition. This function returns the real State. * NORMAL State with a condition. This function returns the real State.
*/ */
int int
get_real_state() get_real_state()
@ -2924,11 +2924,15 @@ get_real_state()
{ {
#ifdef FEAT_VISUAL #ifdef FEAT_VISUAL
if (VIsual_active) if (VIsual_active)
{
if (VIsual_select)
return SELECTMODE;
return VISUAL; return VISUAL;
}
else else
#endif #endif
if (finish_op) if (finish_op)
return OP_PENDING; return OP_PENDING;
} }
return State; return State;
} }

View File

@ -79,10 +79,11 @@ static qf_info_T ql_info; /* global quickfix list */
/* /*
* Structure used to hold the info of one part of 'errorformat' * Structure used to hold the info of one part of 'errorformat'
*/ */
struct eformat typedef struct efm_S efm_T;
struct efm_S
{ {
regprog_T *prog; /* pre-formatted part of 'errorformat' */ regprog_T *prog; /* pre-formatted part of 'errorformat' */
struct eformat *next; /* pointer to next (NULL if last) */ efm_T *next; /* pointer to next (NULL if last) */
char_u addr[FMT_PATTERNS]; /* indices of used % patterns */ char_u addr[FMT_PATTERNS]; /* indices of used % patterns */
char_u prefix; /* prefix of this format line: */ char_u prefix; /* prefix of this format line: */
/* 'D' enter directory */ /* 'D' enter directory */
@ -100,6 +101,7 @@ struct eformat
char_u flags; /* additional flags given in prefix */ char_u flags; /* additional flags given in prefix */
/* '-' do not include this line */ /* '-' do not include this line */
/* '+' include whole line in message */ /* '+' include whole line in message */
int conthere; /* %> used */
}; };
static int qf_init_ext __ARGS((qf_info_T *qi, char_u *efile, buf_T *buf, typval_T *tv, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast)); static int qf_init_ext __ARGS((qf_info_T *qi, char_u *efile, buf_T *buf, typval_T *tv, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast));
@ -198,9 +200,10 @@ qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast)
FILE *fd = NULL; FILE *fd = NULL;
qfline_T *qfprev = NULL; /* init to make SASC shut up */ qfline_T *qfprev = NULL; /* init to make SASC shut up */
char_u *efmp; char_u *efmp;
struct eformat *fmt_first = NULL; efm_T *fmt_first = NULL;
struct eformat *fmt_last = NULL; efm_T *fmt_last = NULL;
struct eformat *fmt_ptr; efm_T *fmt_ptr;
efm_T *fmt_start = NULL;
char_u *efm; char_u *efm;
char_u *ptr; char_u *ptr;
char_u *srcptr; char_u *srcptr;
@ -281,12 +284,12 @@ qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast)
if ((fmtstr = alloc(i)) == NULL) if ((fmtstr = alloc(i)) == NULL)
goto error2; goto error2;
while (efm[0]) while (efm[0] != NUL)
{ {
/* /*
* Allocate a new eformat structure and put it at the end of the list * Allocate a new eformat structure and put it at the end of the list
*/ */
fmt_ptr = (struct eformat *)alloc((unsigned)sizeof(struct eformat)); fmt_ptr = (efm_T *)alloc_clear((unsigned)sizeof(efm_T));
if (fmt_ptr == NULL) if (fmt_ptr == NULL)
goto error2; goto error2;
if (fmt_first == NULL) /* first one */ if (fmt_first == NULL) /* first one */
@ -294,13 +297,6 @@ qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast)
else else
fmt_last->next = fmt_ptr; fmt_last->next = fmt_ptr;
fmt_last = fmt_ptr; fmt_last = fmt_ptr;
fmt_ptr->prefix = NUL;
fmt_ptr->flags = NUL;
fmt_ptr->next = NULL;
fmt_ptr->prog = NULL;
for (round = FMT_PATTERNS; round > 0; )
fmt_ptr->addr[--round] = NUL;
/* round is 0 now */
/* /*
* Isolate one part in the 'errorformat' option * Isolate one part in the 'errorformat' option
@ -314,6 +310,7 @@ qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast)
*/ */
ptr = fmtstr; ptr = fmtstr;
*ptr++ = '^'; *ptr++ = '^';
round = 0;
for (efmp = efm; efmp < efm + len; ++efmp) for (efmp = efm; efmp < efm + len; ++efmp)
{ {
if (*efmp == '%') if (*efmp == '%')
@ -425,6 +422,8 @@ qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast)
*ptr++ = *efmp; /* regexp magic characters */ *ptr++ = *efmp; /* regexp magic characters */
else if (*efmp == '#') else if (*efmp == '#')
*ptr++ = '*'; *ptr++ = '*';
else if (*efmp == '>')
fmt_ptr->conthere = TRUE;
else if (efmp == efm + 1) /* analyse prefix */ else if (efmp == efm + 1) /* analyse prefix */
{ {
if (vim_strchr((char_u *)"+-", *efmp) != NULL) if (vim_strchr((char_u *)"+-", *efmp) != NULL)
@ -561,13 +560,22 @@ qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast)
*efmp = NUL; *efmp = NUL;
#endif #endif
/* If there was no %> item start at the first pattern */
if (fmt_start == NULL)
fmt_ptr = fmt_first;
else
{
fmt_ptr = fmt_start;
fmt_start = NULL;
}
/* /*
* Try to match each part of 'errorformat' until we find a complete * Try to match each part of 'errorformat' until we find a complete
* match or no match. * match or no match.
*/ */
valid = TRUE; valid = TRUE;
restofline: restofline:
for (fmt_ptr = fmt_first; fmt_ptr != NULL; fmt_ptr = fmt_ptr->next) for ( ; fmt_ptr != NULL; fmt_ptr = fmt_ptr->next)
{ {
idx = fmt_ptr->prefix; idx = fmt_ptr->prefix;
if (multiscan && vim_strchr((char_u *)"OPQ", idx) == NULL) if (multiscan && vim_strchr((char_u *)"OPQ", idx) == NULL)
@ -651,6 +659,7 @@ restofline:
} }
} }
multiscan = FALSE; multiscan = FALSE;
if (fmt_ptr == NULL || idx == 'D' || idx == 'X') if (fmt_ptr == NULL || idx == 'D' || idx == 'X')
{ {
if (fmt_ptr != NULL) if (fmt_ptr != NULL)
@ -677,6 +686,10 @@ restofline:
} }
else if (fmt_ptr != NULL) else if (fmt_ptr != NULL)
{ {
/* honor %> item */
if (fmt_ptr->conthere)
fmt_start = fmt_ptr;
if (vim_strchr((char_u *)"AEWI", idx) != NULL) if (vim_strchr((char_u *)"AEWI", idx) != NULL)
multiline = TRUE; /* start of a multi-line message */ multiline = TRUE; /* start of a multi-line message */
else if (vim_strchr((char_u *)"CZ", idx) != NULL) else if (vim_strchr((char_u *)"CZ", idx) != NULL)