mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #9067 from janlazo/vim-8.0.1485
This commit is contained in:
commit
c6d36b97ba
@ -4533,9 +4533,10 @@ do_arg_all (
|
||||
use_firstwin = true;
|
||||
}
|
||||
|
||||
for (i = 0; i < count && i < opened_len && !got_int; ++i) {
|
||||
if (alist == &global_alist && i == global_alist.al_ga.ga_len - 1)
|
||||
arg_had_last = TRUE;
|
||||
for (i = 0; i < count && i < opened_len && !got_int; i++) {
|
||||
if (alist == &global_alist && i == global_alist.al_ga.ga_len - 1) {
|
||||
arg_had_last = true;
|
||||
}
|
||||
if (opened[i] > 0) {
|
||||
/* Move the already present window to below the current window */
|
||||
if (curwin->w_arg_idx != i) {
|
||||
|
@ -14664,6 +14664,7 @@ static void set_qf_ll_list(win_T *wp, typval_T *args, typval_T *rettv)
|
||||
static char *e_invact = N_("E927: Invalid action: '%s'");
|
||||
const char *title = NULL;
|
||||
int action = ' ';
|
||||
static int recursive = 0;
|
||||
rettv->vval.v_number = -1;
|
||||
dict_T *d = NULL;
|
||||
|
||||
@ -14671,6 +14672,9 @@ static void set_qf_ll_list(win_T *wp, typval_T *args, typval_T *rettv)
|
||||
if (list_arg->v_type != VAR_LIST) {
|
||||
EMSG(_(e_listreq));
|
||||
return;
|
||||
} else if (recursive != 0) {
|
||||
EMSG(_(e_au_recursive));
|
||||
return;
|
||||
}
|
||||
|
||||
typval_T *action_arg = &args[1];
|
||||
@ -14712,10 +14716,12 @@ skip_args:
|
||||
title = (wp ? "setloclist()" : "setqflist()");
|
||||
}
|
||||
|
||||
recursive++;
|
||||
list_T *const l = list_arg->vval.v_list;
|
||||
if (set_errorlist(wp, l, action, (char_u *)title, d) == OK) {
|
||||
rettv->vval.v_number = 0;
|
||||
}
|
||||
recursive--;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -6536,6 +6536,13 @@ void alist_expand(int *fnum_list, int fnum_len)
|
||||
void alist_set(alist_T *al, int count, char_u **files, int use_curbuf, int *fnum_list, int fnum_len)
|
||||
{
|
||||
int i;
|
||||
static int recursive = 0;
|
||||
|
||||
if (recursive) {
|
||||
EMSG(_(e_au_recursive));
|
||||
return;
|
||||
}
|
||||
recursive++;
|
||||
|
||||
alist_clear(al);
|
||||
ga_grow(&al->al_ga, count);
|
||||
@ -6560,8 +6567,10 @@ void alist_set(alist_T *al, int count, char_u **files, int use_curbuf, int *fnum
|
||||
xfree(files);
|
||||
}
|
||||
|
||||
if (al == &global_alist)
|
||||
arg_had_last = FALSE;
|
||||
if (al == &global_alist) {
|
||||
arg_had_last = false;
|
||||
}
|
||||
recursive--;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -528,8 +528,8 @@ EXTERN buf_T *curbuf INIT(= NULL); // currently active buffer
|
||||
*/
|
||||
EXTERN alist_T global_alist; /* global argument list */
|
||||
EXTERN int max_alist_id INIT(= 0); ///< the previous argument list id
|
||||
EXTERN int arg_had_last INIT(= FALSE); /* accessed last file in
|
||||
global_alist */
|
||||
EXTERN bool arg_had_last INIT(= false); // accessed last file in
|
||||
// global_alist
|
||||
|
||||
EXTERN int ru_col; /* column for ruler */
|
||||
EXTERN int ru_wid; /* 'rulerfmt' width of ruler when non-zero */
|
||||
@ -1099,6 +1099,8 @@ EXTERN char_u e_notset[] INIT(= N_("E764: Option '%s' is not set"));
|
||||
EXTERN char_u e_invalidreg[] INIT(= N_("E850: Invalid register name"));
|
||||
EXTERN char_u e_dirnotf[] INIT(= N_(
|
||||
"E919: Directory not found in '%s': \"%s\""));
|
||||
EXTERN char_u e_au_recursive[] INIT(= N_(
|
||||
"E952: Autocommand caused recursive behavior"));
|
||||
EXTERN char_u e_unsupportedoption[] INIT(= N_("E519: Option not supported"));
|
||||
EXTERN char_u e_fnametoolong[] INIT(= N_("E856: Filename too long"));
|
||||
EXTERN char_u e_float_as_string[] INIT(= N_("E806: using Float as a String"));
|
||||
|
@ -1624,9 +1624,10 @@ static void edit_buffers(mparm_T *parmp, char_u *cwd)
|
||||
win_close(curwin, true);
|
||||
advance = false;
|
||||
}
|
||||
if (arg_idx == GARGCOUNT - 1)
|
||||
arg_had_last = TRUE;
|
||||
++arg_idx;
|
||||
if (arg_idx == GARGCOUNT - 1) {
|
||||
arg_had_last = true;
|
||||
}
|
||||
arg_idx++;
|
||||
}
|
||||
os_breakcheck();
|
||||
if (got_int) {
|
||||
|
@ -2434,7 +2434,7 @@ did_set_string_option (
|
||||
int did_chartab = FALSE;
|
||||
char_u **gvarp;
|
||||
bool free_oldval = (options[opt_idx].flags & P_ALLOCED);
|
||||
int ft_changed = false;
|
||||
bool value_changed = false;
|
||||
|
||||
/* Get the global option to compare with, otherwise we would have to check
|
||||
* two values for all local options. */
|
||||
@ -3155,11 +3155,13 @@ did_set_string_option (
|
||||
if (!valid_filetype(*varp)) {
|
||||
errmsg = e_invarg;
|
||||
} else {
|
||||
ft_changed = STRCMP(oldval, *varp) != 0;
|
||||
value_changed = STRCMP(oldval, *varp) != 0;
|
||||
}
|
||||
} else if (gvarp == &p_syn) {
|
||||
if (!valid_filetype(*varp)) {
|
||||
errmsg = e_invarg;
|
||||
} else {
|
||||
value_changed = STRCMP(oldval, *varp) != 0;
|
||||
}
|
||||
} else if (varp == &curwin->w_p_winhl) {
|
||||
if (!parse_winhl_opt(curwin)) {
|
||||
@ -3235,14 +3237,28 @@ did_set_string_option (
|
||||
*/
|
||||
/* When 'syntax' is set, load the syntax of that name */
|
||||
if (varp == &(curbuf->b_p_syn)) {
|
||||
apply_autocmds(EVENT_SYNTAX, curbuf->b_p_syn,
|
||||
curbuf->b_fname, TRUE, curbuf);
|
||||
static int syn_recursive = 0;
|
||||
|
||||
syn_recursive++;
|
||||
// Only pass true for "force" when the value changed or not used
|
||||
// recursively, to avoid endless recurrence.
|
||||
apply_autocmds(EVENT_SYNTAX, curbuf->b_p_syn, curbuf->b_fname,
|
||||
value_changed || syn_recursive == 1, curbuf);
|
||||
syn_recursive--;
|
||||
} else if (varp == &(curbuf->b_p_ft)) {
|
||||
// 'filetype' is set, trigger the FileType autocommand
|
||||
if (!(opt_flags & OPT_MODELINE) || ft_changed) {
|
||||
// Skip this when called from a modeline and the filetype was
|
||||
// already set to this value.
|
||||
if (!(opt_flags & OPT_MODELINE) || value_changed) {
|
||||
static int ft_recursive = 0;
|
||||
|
||||
ft_recursive++;
|
||||
did_filetype = true;
|
||||
apply_autocmds(EVENT_FILETYPE, curbuf->b_p_ft,
|
||||
curbuf->b_fname, true, curbuf);
|
||||
// Only pass true for "force" when the value changed or not
|
||||
// used recursively, to avoid endless recurrence.
|
||||
apply_autocmds(EVENT_FILETYPE, curbuf->b_p_ft, curbuf->b_fname,
|
||||
value_changed || ft_recursive == 1, curbuf);
|
||||
ft_recursive--;
|
||||
// Just in case the old "curbuf" is now invalid
|
||||
if (varp != &(curbuf->b_p_ft)) {
|
||||
varp = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user