mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 13:58:18 +00:00
linter: make changes pass the linter
This commit is contained in:
@@ -296,7 +296,8 @@ linenr_T get_cursor_rel_lnum(win_T *wp, linenr_T lnum)
|
|||||||
|
|
||||||
// Make sure "pos.lnum" and "pos.col" are valid in "buf".
|
// Make sure "pos.lnum" and "pos.col" are valid in "buf".
|
||||||
// This allows for the col to be on the NUL byte.
|
// This allows for the col to be on the NUL byte.
|
||||||
void check_pos(buf_T *buf, pos_T *pos) {
|
void check_pos(buf_T *buf, pos_T *pos)
|
||||||
|
{
|
||||||
char_u *line;
|
char_u *line;
|
||||||
colnr_T len;
|
colnr_T len;
|
||||||
|
|
||||||
@@ -305,10 +306,11 @@ void check_pos(buf_T *buf, pos_T *pos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pos->col > 0) {
|
if (pos->col > 0) {
|
||||||
line = ml_get_buf(buf, pos->lnum, FALSE);
|
line = ml_get_buf(buf, pos->lnum, false);
|
||||||
len = (colnr_T)STRLEN(line);
|
len = (colnr_T)STRLEN(line);
|
||||||
if (pos->col > len)
|
if (pos->col > len) {
|
||||||
pos->col = len;
|
pos->col = len;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1878,8 +1878,9 @@ int onepage(int dir, long count)
|
|||||||
}
|
}
|
||||||
foldAdjustCursor();
|
foldAdjustCursor();
|
||||||
check_cursor_col();
|
check_cursor_col();
|
||||||
if (retval == OK)
|
if (retval == OK) {
|
||||||
beginline(BL_SOL | BL_FIX);
|
beginline(BL_SOL | BL_FIX);
|
||||||
|
}
|
||||||
curwin->w_valid &= ~(VALID_WCOL|VALID_WROW|VALID_VIRTCOL);
|
curwin->w_valid &= ~(VALID_WCOL|VALID_WROW|VALID_VIRTCOL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1917,7 +1917,7 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
|
|||||||
// Restore linebreak, so that when the user edits it looks as
|
// Restore linebreak, so that when the user edits it looks as
|
||||||
// before.
|
// before.
|
||||||
curwin->w_p_lbr = lbr_saved;
|
curwin->w_p_lbr = lbr_saved;
|
||||||
op_function(oap); /* call 'operatorfunc' */
|
op_function(oap); // call 'operatorfunc'
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OP_INSERT:
|
case OP_INSERT:
|
||||||
@@ -4769,10 +4769,10 @@ static void nv_ident(cmdarg_T *cap)
|
|||||||
ptr = vim_strnsave(ptr, n);
|
ptr = vim_strnsave(ptr, n);
|
||||||
if (kp_ex) {
|
if (kp_ex) {
|
||||||
// Escape the argument properly for an Ex command
|
// Escape the argument properly for an Ex command
|
||||||
p = vim_strsave_fnameescape(ptr, FALSE);
|
p = vim_strsave_fnameescape(ptr, false);
|
||||||
} else {
|
} else {
|
||||||
// Escape the argument properly for a shell command
|
// Escape the argument properly for a shell command
|
||||||
p = vim_strsave_shellescape(ptr, TRUE, TRUE);
|
p = vim_strsave_shellescape(ptr, true, true);
|
||||||
}
|
}
|
||||||
xfree(ptr);
|
xfree(ptr);
|
||||||
char *newbuf = xrealloc(buf, STRLEN(buf) + STRLEN(p) + 1);
|
char *newbuf = xrealloc(buf, STRLEN(buf) + STRLEN(p) + 1);
|
||||||
|
@@ -3862,14 +3862,14 @@ fex_format (
|
|||||||
if (fex == NULL) {
|
if (fex == NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*
|
// Evaluate the function.
|
||||||
* Evaluate the function.
|
if (use_sandbox) {
|
||||||
*/
|
sandbox++;
|
||||||
if (use_sandbox)
|
}
|
||||||
++sandbox;
|
|
||||||
r = (int)eval_to_number(fex);
|
r = (int)eval_to_number(fex);
|
||||||
if (use_sandbox)
|
if (use_sandbox) {
|
||||||
--sandbox;
|
sandbox--;
|
||||||
|
}
|
||||||
|
|
||||||
set_vim_var_string(VV_CHAR, NULL, -1);
|
set_vim_var_string(VV_CHAR, NULL, -1);
|
||||||
xfree(fex);
|
xfree(fex);
|
||||||
|
Reference in New Issue
Block a user