diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/vimscript.c | 4 | ||||
-rw-r--r-- | src/nvim/buffer_updates.c | 2 | ||||
-rw-r--r-- | src/nvim/edit.c | 4 | ||||
-rw-r--r-- | src/nvim/eval.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 10 | ||||
-rw-r--r-- | src/nvim/extmark.c | 10 | ||||
-rw-r--r-- | src/nvim/extmark.h | 2 |
7 files changed, 17 insertions, 17 deletions
diff --git a/src/nvim/api/vimscript.c b/src/nvim/api/vimscript.c index d3675a3c40..9396435466 100644 --- a/src/nvim/api/vimscript.c +++ b/src/nvim/api/vimscript.c @@ -752,7 +752,7 @@ Dictionary nvim_parse_expression(String expr, String flags, Boolean highlight, E /// no range was specified, one element if only a single range item was /// specified and two elements if both range items were specified. /// - count: (number) Any |<count>| that was supplied to the command. -1 if command cannot -/// take a count. Mutually exclusive with "range". +/// take a count. /// - reg: (number) The optional command |<register>|, if specified. Empty string if not /// specified or if command cannot take a register. /// - bang: (boolean) Whether command contains a |<bang>| (!) modifier. @@ -853,7 +853,7 @@ Dictionary nvim_parse_cmd(String str, Dictionary opts, Error *err) PUT(result, "cmd", CSTR_TO_OBJ((char *)get_command_name(NULL, ea.cmdidx))); } - if ((ea.argt & EX_RANGE) && !(ea.argt & EX_COUNT) && ea.addr_count > 0) { + if ((ea.argt & EX_RANGE) && ea.addr_count > 0) { Array range = ARRAY_DICT_INIT; if (ea.addr_count > 1) { ADD(range, INTEGER_OBJ(ea.line1)); diff --git a/src/nvim/buffer_updates.c b/src/nvim/buffer_updates.c index 49e3a03dac..3e2d04b3a2 100644 --- a/src/nvim/buffer_updates.c +++ b/src/nvim/buffer_updates.c @@ -299,7 +299,7 @@ void buf_updates_send_changes(buf_T *buf, linenr_T firstline, int64_t num_added, kv_size(buf->update_callbacks) = j; } -void buf_updates_send_splice(buf_T *buf, linenr_T start_row, colnr_T start_col, bcount_t start_byte, +void buf_updates_send_splice(buf_T *buf, int start_row, colnr_T start_col, bcount_t start_byte, int old_row, colnr_T old_col, bcount_t old_byte, int new_row, colnr_T new_col, bcount_t new_byte) { diff --git a/src/nvim/edit.c b/src/nvim/edit.c index ab80f09228..a608612af5 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -2002,7 +2002,7 @@ void change_indent(int type, int amount, int round, int replaced, int call_chang // TODO(bfredl): test for crazy edge cases, like we stand on a TAB or // something? does this even do the right text change then? int delta = orig_col - new_col; - extmark_splice_cols(curbuf, curwin->w_cursor.lnum - 1, new_col, + extmark_splice_cols(curbuf, (int)curwin->w_cursor.lnum - 1, new_col, delta < 0 ? -delta : 0, delta > 0 ? delta : 0, kExtmarkUndo); @@ -9118,7 +9118,7 @@ static bool ins_tab(void) } } if (!(State & VREPLACE_FLAG)) { - extmark_splice_cols(curbuf, fpos.lnum - 1, change_col, + extmark_splice_cols(curbuf, (int)fpos.lnum - 1, change_col, cursor->col - change_col, fpos.col - change_col, kExtmarkUndo); } diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d910b47c57..548dd96444 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6632,7 +6632,7 @@ void get_user_input(const typval_T *const argvars, typval_T *const rettv, const // input() with a third argument: completion const int xp_namelen = (int)strlen(xp_name); - uint32_t argt; + uint32_t argt = 0; if (parse_compl_arg(xp_name, xp_namelen, &xp_type, &argt, &xp_arg) == FAIL) { return; diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index d2b833305b..a54d1a14ce 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1320,7 +1320,7 @@ static void parse_register(exarg_T *eap) } } -static int parse_count(exarg_T *eap, char **errormsg) +static int parse_count(exarg_T *eap, char **errormsg, bool validate) { // Check for a count. When accepting a EX_BUFNAME, don't use "123foo" as a // count, it's a buffer name. @@ -1348,7 +1348,7 @@ static int parse_count(exarg_T *eap, char **errormsg) eap->line2 += n - 1; eap->addr_count++; // Be vi compatible: no error message for out of range. - if (eap->line2 > curbuf->b_ml.ml_line_count) { + if (validate && eap->line2 > curbuf->b_ml.ml_line_count) { eap->line2 = curbuf->b_ml.ml_line_count; } } @@ -1426,7 +1426,7 @@ bool parse_cmdline(char *cmdline, exarg_T *eap, CmdParseInfo *cmdinfo, char **er } p = find_command(eap, NULL); - // Set command attribute type and parse command range + // Set command address type and parse command range set_cmd_addr_type(eap, (char_u *)p); eap->cmd = cmd; if (parse_cmd_address(eap, errormsg, false) == FAIL) { @@ -1499,7 +1499,7 @@ bool parse_cmdline(char *cmdline, exarg_T *eap, CmdParseInfo *cmdinfo, char **er // Parse register and count parse_register(eap); - if (parse_count(eap, errormsg) == FAIL) { + if (parse_count(eap, errormsg, false) == FAIL) { return false; } @@ -1981,7 +1981,7 @@ static char *do_one_cmd(char **cmdlinep, int flags, cstack_T *cstack, LineGetter // Parse register and count parse_register(&ea); - if (parse_count(&ea, &errormsg) == FAIL) { + if (parse_count(&ea, &errormsg, true) == FAIL) { goto doend; } diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c index 09ea2be4fe..f367bc66e0 100644 --- a/src/nvim/extmark.c +++ b/src/nvim/extmark.c @@ -417,7 +417,7 @@ static void u_extmark_set(buf_T *buf, uint64_t mark, int row, colnr_T col) /// /// useful when we cannot simply reverse the operation. This will do nothing on /// redo, enforces correct position when undo. -void u_extmark_copy(buf_T *buf, linenr_T l_row, colnr_T l_col, linenr_T u_row, colnr_T u_col) +void u_extmark_copy(buf_T *buf, int l_row, colnr_T l_col, int u_row, colnr_T u_col) { u_header_T *uhp = u_force_get_undo_header(buf); if (!uhp) { @@ -553,7 +553,7 @@ void extmark_adjust(buf_T *buf, linenr_T line1, linenr_T line2, long amount, lon // the end column of the new region. // @param new_byte Byte extent of the new region. // @param undo -void extmark_splice(buf_T *buf, linenr_T start_row, colnr_T start_col, int old_row, colnr_T old_col, +void extmark_splice(buf_T *buf, int start_row, colnr_T start_col, int old_row, colnr_T old_col, bcount_t old_byte, int new_row, colnr_T new_col, bcount_t new_byte, ExtmarkOp undo) { @@ -573,7 +573,7 @@ void extmark_splice(buf_T *buf, linenr_T start_row, colnr_T start_col, int old_r undo); } -void extmark_splice_impl(buf_T *buf, linenr_T start_row, colnr_T start_col, bcount_t start_byte, +void extmark_splice_impl(buf_T *buf, int start_row, colnr_T start_col, bcount_t start_byte, int old_row, colnr_T old_col, bcount_t old_byte, int new_row, colnr_T new_col, bcount_t new_byte, ExtmarkOp undo) { @@ -588,7 +588,7 @@ void extmark_splice_impl(buf_T *buf, linenr_T start_row, colnr_T start_col, bcou // beginning and right-gravity at the end need not be preserved. // Also be smart about marks that already have been saved (important for // merge!) - linenr_T end_row = start_row + old_row; + int end_row = start_row + old_row; int end_col = (old_row ? 0 : start_col) + old_col; u_extmark_copy(buf, start_row, start_col, end_row, end_col); } @@ -656,7 +656,7 @@ void extmark_splice_impl(buf_T *buf, linenr_T start_row, colnr_T start_col, bcou } } -void extmark_splice_cols(buf_T *buf, linenr_T start_row, colnr_T start_col, colnr_T old_col, +void extmark_splice_cols(buf_T *buf, int start_row, colnr_T start_col, colnr_T old_col, colnr_T new_col, ExtmarkOp undo) { extmark_splice(buf, start_row, start_col, diff --git a/src/nvim/extmark.h b/src/nvim/extmark.h index 84d1e8d03b..b856a1148f 100644 --- a/src/nvim/extmark.h +++ b/src/nvim/extmark.h @@ -29,7 +29,7 @@ typedef ptrdiff_t bcount_t; // delete the columns between mincol and endcol typedef struct { - linenr_T start_row; + int start_row; colnr_T start_col; int old_row; colnr_T old_col; |