mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 08:28:34 +00:00
Enable -Wconversion: normal.c.
Refactor summary: - extern int opcount --> extern long opcount - bool find_decl(..., int len, ...) --> bool find_decl(..., size_t len, ...) * int find_ident_under_cursor(...) --> size_t find_ident_under_cursor(...) - int find_ident_at_pos(...) --> size_t find_ident_at_pos(...) - int modify_fname(..., int *usedlen, ..., int *fnamelen) --> int modify_fname(..., size_t *usedlen, ..., size_t *fnamelen) * char_u *eval_vars(..., int *usedlen, ...) --> char_u *eval_vars(..., size_t *usedlen, ...) - int find_cmdline_var(..., int *usedlen) --> ssize_t find_cmdline_var(..., size_t *usedlen) - static char_u *repl_cmdline(..., int srclen, ...) --> static char_u *repl_cmdline(..., size_t srclen, ...) - bool get_visual_text(..., int *lenp) --> bool get_visual_text(..., size_t *lenp) * char_u *find_file_name_in_path(..., int len, ...) --> char_u *find_file_name_in_path(..., size_t len, ...) - static char_u *eval_includeexpr(..., int len) --> static char_u *eval_includeexpr(..., size_t len) - char_u *find_file_in_path(..., int len, ...) --> char_u *find_file_in_path(..., size_t len, ...) * char_u *find_file_in_path_option(..., int len, ...) --> char_u *find_file_in_path_option(..., size_t len, ...) - char_u *find_directory_in_path(..., int len, ...) --> char_u *find_directory_in_path(..., size_t len, ...) * int spell_move_to(...) --> size_t spell_move_to(...) - int spell_check(...) --> size_t spell_check(...) - static int spell_bad_len --> static size_t spell_bad_len - void find_pattern_in_path(..., int len, ...) --> void find_pattern_in_path(..., size_t len, ...) Helped-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
@@ -192,7 +192,7 @@ static int compl_opt_refresh_always = FALSE;
|
||||
#define BACKSPACE_WORD_NOT_SPACE 3
|
||||
#define BACKSPACE_LINE 4
|
||||
|
||||
static int spell_bad_len = 0; /* length of located bad word */
|
||||
static size_t spell_bad_len = 0; /* length of located bad word */
|
||||
|
||||
static colnr_T Insstart_textlen; /* length of line when insert started */
|
||||
static colnr_T Insstart_blank_vcol; /* vcol for first inserted blank */
|
||||
@@ -3539,11 +3539,12 @@ static int ins_compl_get_exp(pos_T *ini)
|
||||
case CTRL_X_PATH_PATTERNS:
|
||||
case CTRL_X_PATH_DEFINES:
|
||||
find_pattern_in_path(compl_pattern, compl_direction,
|
||||
(int)STRLEN(compl_pattern), FALSE, FALSE,
|
||||
(type == CTRL_X_PATH_DEFINES
|
||||
&& !(compl_cont_status & CONT_SOL))
|
||||
? FIND_DEFINE : FIND_ANY, 1L, ACTION_EXPAND,
|
||||
(linenr_T)1, (linenr_T)MAXLNUM);
|
||||
STRLEN(compl_pattern), FALSE, FALSE,
|
||||
((type == CTRL_X_PATH_DEFINES
|
||||
&& !(compl_cont_status & CONT_SOL))
|
||||
? FIND_DEFINE
|
||||
: FIND_ANY),
|
||||
1L, ACTION_EXPAND, 1, MAXLNUM);
|
||||
break;
|
||||
|
||||
case CTRL_X_DICTIONARY:
|
||||
@@ -4401,8 +4402,10 @@ static int ins_complete(int c)
|
||||
compl_length = curs_col - compl_col;
|
||||
compl_pattern = vim_strnsave(line + compl_col, compl_length);
|
||||
} else if (ctrl_x_mode == CTRL_X_SPELL) {
|
||||
if (spell_bad_len > 0)
|
||||
compl_col = curs_col - spell_bad_len;
|
||||
if (spell_bad_len > 0) {
|
||||
assert(spell_bad_len <= INT_MAX);
|
||||
compl_col = curs_col - (int)spell_bad_len;
|
||||
}
|
||||
else
|
||||
compl_col = spell_word_start(startcol);
|
||||
if (compl_col >= (colnr_T)startcol) {
|
||||
@@ -5590,7 +5593,6 @@ static void check_spell_redraw(void)
|
||||
static void spell_back_to_badword(void)
|
||||
{
|
||||
pos_T tpos = curwin->w_cursor;
|
||||
|
||||
spell_bad_len = spell_move_to(curwin, BACKWARD, TRUE, TRUE, NULL);
|
||||
if (curwin->w_cursor.col != tpos.col)
|
||||
start_arrow(&tpos);
|
||||
|
Reference in New Issue
Block a user