edit: fix variables in ins_mousescroll()

Declare and initialize them on same line.
Add const if possible.
Refactor 'did_scroll' local variable from int to bool.
This commit is contained in:
Jan Edmund Lazo
2018-08-06 11:14:02 -04:00
parent 4df0ea98dc
commit 8f75debd86

View File

@@ -7871,17 +7871,13 @@ static void ins_mouse(int c)
static void ins_mousescroll(int dir) static void ins_mousescroll(int dir)
{ {
pos_T tpos; win_T *const old_curwin = curwin;
win_T *old_curwin = curwin; bool did_scroll = false;
int did_scroll = FALSE; pos_T tpos = curwin->w_cursor;
tpos = curwin->w_cursor;
if (mouse_row >= 0 && mouse_col >= 0) { if (mouse_row >= 0 && mouse_col >= 0) {
int row, col; int row = mouse_row;
int col = mouse_col;
row = mouse_row;
col = mouse_col;
/* find the window at the pointer coordinates */ /* find the window at the pointer coordinates */
win_T *const wp = mouse_find_win(&row, &col); win_T *const wp = mouse_find_win(&row, &col);
@@ -7907,7 +7903,7 @@ static void ins_mousescroll(int dir)
} else { } else {
mouse_scroll_horiz(dir); mouse_scroll_horiz(dir);
} }
did_scroll = TRUE; did_scroll = true;
} }
curwin->w_redr_status = TRUE; curwin->w_redr_status = TRUE;