From 8f75debd867694e6ea709d4eb83e121d643df7e3 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 6 Aug 2018 11:14:02 -0400 Subject: 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. --- src/nvim/edit.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 4e4ca1f8f3..c8eae55c81 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -7871,17 +7871,13 @@ static void ins_mouse(int c) static void ins_mousescroll(int dir) { - pos_T tpos; - win_T *old_curwin = curwin; - int did_scroll = FALSE; - - tpos = curwin->w_cursor; + win_T *const old_curwin = curwin; + bool did_scroll = false; + pos_T tpos = curwin->w_cursor; if (mouse_row >= 0 && mouse_col >= 0) { - int row, col; - - row = mouse_row; - col = mouse_col; + int row = mouse_row; + int col = mouse_col; /* find the window at the pointer coordinates */ win_T *const wp = mouse_find_win(&row, &col); @@ -7907,7 +7903,7 @@ static void ins_mousescroll(int dir) } else { mouse_scroll_horiz(dir); } - did_scroll = TRUE; + did_scroll = true; } curwin->w_redr_status = TRUE; -- cgit