diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-06 11:14:02 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-06 11:49:59 -0400 |
commit | 8f75debd867694e6ea709d4eb83e121d643df7e3 (patch) | |
tree | e2ccd573ffdbcd58303d97c9450ddee218e008be /src | |
parent | 4df0ea98dc4597d91168d239ca366d1d575e95e6 (diff) | |
download | rneovim-8f75debd867694e6ea709d4eb83e121d643df7e3.tar.gz rneovim-8f75debd867694e6ea709d4eb83e121d643df7e3.tar.bz2 rneovim-8f75debd867694e6ea709d4eb83e121d643df7e3.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/edit.c | 16 |
1 files changed, 6 insertions, 10 deletions
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; |