diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/vim.c | 2 | ||||
-rw-r--r-- | src/nvim/eval.c | 2 | ||||
-rw-r--r-- | src/nvim/eval.lua | 10 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 3 | ||||
-rw-r--r-- | src/nvim/highlight.c | 2 | ||||
-rw-r--r-- | src/nvim/insexpand.c | 2 | ||||
-rw-r--r-- | src/nvim/move.c | 2 | ||||
-rw-r--r-- | src/nvim/strings.c | 8 | ||||
-rw-r--r-- | src/nvim/window.c | 6 |
9 files changed, 21 insertions, 16 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index b8e0934669..ce3eca52b5 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -587,7 +587,7 @@ ArrayOf(String) nvim__get_runtime(Array pat, Boolean all, Dict(runtime) *opts, E FUNC_API_SINCE(8) FUNC_API_FAST { - VALIDATE((!opts->do_source || nlua_is_deferred_safe()), "%s", "'do_source' used in fast callback", + VALIDATE(!opts->do_source || nlua_is_deferred_safe(), "%s", "'do_source' used in fast callback", {}); if (ERROR_SET(err)) { return (Array)ARRAY_DICT_INIT; diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 9a90e430a7..12226dac91 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -1299,7 +1299,7 @@ int eval_foldexpr(win_T *wp, int *cp) // If the result is a string, check if there is a non-digit before // the number. char *s = tv.vval.v_string; - if (!ascii_isdigit(*s) && *s != '-') { + if (*s != NUL && !ascii_isdigit(*s) && *s != '-') { *cp = (uint8_t)(*s++); } retval = atol(s); diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 28fb9c6a5c..5a47286980 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -7381,8 +7381,6 @@ M.funcs = { precision, the argument(s) to be used must also be specified using a {n$} positional argument specifier. See |printf-$|. - - *E1520* The conversion specifiers and their meanings are: *printf-d* *printf-b* *printf-B* *printf-o* *printf-x* *printf-X* @@ -7572,6 +7570,14 @@ M.funcs = { echo printf("%1$d at width %2$d is: %01$*2$.3$d", 1, 2) < E1505: Invalid format specifier: %1$d at width %2$d is: %01$*2$.3$d + + *E1507* + This internal error indicates that the logic to parse a + positional format argument ran into a problem that couldn't be + otherwise reported. Please file a bug against Vim if you run + into this, copying the exact format string and parameters that + were used. + ]=], name = 'printf', params = { { 'fmt', 'any' }, { 'expr1', 'any' } }, diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index eb89e0fc9d..95490a0a10 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -3142,9 +3142,6 @@ void f_fullcommand(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; - if (name == NULL) { - return; - } while (*name == ':') { name++; diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c index 14239f44cc..337f9e968d 100644 --- a/src/nvim/highlight.c +++ b/src/nvim/highlight.c @@ -332,7 +332,7 @@ void update_window_hl(win_T *wp, bool invalid) wp->w_ns_hl_active = ns_id; wp->w_ns_hl_attr = *(NSHlAttr *)pmap_get(int)(&ns_hl_attr, ns_id); - if (!wp->w_ns_hl_attr) { + if (!wp->w_ns_hl_attr) { // -V547 // No specific highlights, use the defaults. wp->w_ns_hl_attr = highlight_attr; } diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 3ada39c800..5ac40d7238 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -3309,7 +3309,7 @@ static int ins_compl_get_exp(pos_T *ini) xfree(st.e_cpt_copy); // Make a copy of 'complete', in case the buffer is wiped out. st.e_cpt_copy = xstrdup((compl_cont_status & CONT_LOCAL) ? "." : curbuf->b_p_cpt); - st.e_cpt = st.e_cpt_copy == NULL ? "" : st.e_cpt_copy; + st.e_cpt = st.e_cpt_copy; st.last_match_pos = st.first_match_pos = *ini; } else if (st.ins_buf != curbuf && !buf_valid(st.ins_buf)) { st.ins_buf = curbuf; // In case the buffer was wiped out. diff --git a/src/nvim/move.c b/src/nvim/move.c index 55cd90c5ae..8eaf40d135 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -1313,7 +1313,6 @@ bool scrolldown(long line_count, int byfold) } if (col > width2 && width2 > 0) { row += (int)col / width2; - col = col % width2; } if (row >= curwin->w_height_inner) { curwin->w_curswant = curwin->w_virtcol - (row - curwin->w_height_inner + 1) * width2; @@ -1518,7 +1517,6 @@ void adjust_skipcol(void) } if (col > width2) { row += (int)col / width2; - col = col % width2; } if (row >= curwin->w_height_inner) { if (curwin->w_skipcol == 0) { diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 0d307a760f..cc66f917f8 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -46,7 +46,7 @@ static const char e_positional_arg_num_type_inconsistent_str_str[] static const char e_invalid_format_specifier_str[] = N_("E1505: Invalid format specifier: %s"); static const char e_aptypes_is_null_nr_str[] - = "E1520: Internal error: ap_types or ap_types[idx] is NULL: %d: %s"; + = "E1507: Internal error: ap_types or ap_types[idx] is NULL: %d: %s"; static const char typename_unknown[] = N_("unknown"); static const char typename_int[] = N_("int"); @@ -1079,7 +1079,7 @@ static int parse_fmt_types(const char ***ap_types, int *num_posarg, const char * any_arg = 1; CHECK_POS_ARG; } - } else if (ascii_isdigit((int)(*(arg = p)))) { + } else if (ascii_isdigit((int)(*p))) { // size_t could be wider than unsigned int; make sure we treat // argument like common implementations do unsigned uj = (unsigned)(*p++ - '0'); @@ -1126,7 +1126,7 @@ static int parse_fmt_types(const char ***ap_types, int *num_posarg, const char * any_arg = 1; CHECK_POS_ARG; } - } else if (ascii_isdigit((int)(*(arg = p)))) { + } else if (ascii_isdigit((int)(*p))) { // size_t could be wider than unsigned int; make sure we // treat argument like common implementations do unsigned uj = (unsigned)(*p++ - '0'); @@ -1155,7 +1155,7 @@ static int parse_fmt_types(const char ***ap_types, int *num_posarg, const char * p++; if (length_modifier == 'l' && *p == 'l') { // double l = long long - length_modifier = 'L'; + // length_modifier = 'L'; p++; } } diff --git a/src/nvim/window.c b/src/nvim/window.c index 16bb7f5df7..04b5afe624 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -4261,7 +4261,11 @@ int may_open_tabpage(void) cmdmod.cmod_tab = 0; // reset it to avoid doing it twice postponed_split_tab = 0; - return win_new_tabpage(n, NULL); + int status = win_new_tabpage(n, NULL); + if (status == OK) { + apply_autocmds(EVENT_TABNEWENTERED, NULL, NULL, false, curbuf); + } + return status; } // Create up to "maxcount" tabpages with empty windows. |