From 542fa8a9cc10abb8eddab25a19844d19b94f53c1 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Tue, 16 Aug 2022 12:26:08 +0100 Subject: refactor: change pre-decrement/increment to post (#19799) Co-authored-by: zeertzjq --- src/nvim/mouse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/mouse.c') diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index a4a521fa80..41afc71a14 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -386,7 +386,7 @@ retnomove: count = 0; for (first = true; curwin->w_topline < curbuf->b_ml.ml_line_count;) { if (curwin->w_topfill > 0) { - ++count; + count++; } else { count += plines_win(curwin, curwin->w_topline, true); } @@ -514,7 +514,7 @@ bool mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump) break; // past end of file } row -= count; - ++lnum; + lnum++; } if (!retval) { -- cgit From f7cfca49d6f1380b2ec0b0f7723ea308d0810857 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 17 Aug 2022 22:18:34 +0800 Subject: refactor: remove some unused includes (#19820) Replace grid.h in screen.h and screen.h in buffer.h with grid_defs.h --- src/nvim/mouse.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/mouse.c') diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index 41afc71a14..ef6f507b5c 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -9,6 +9,7 @@ #include "nvim/cursor.h" #include "nvim/diff.h" #include "nvim/fold.h" +#include "nvim/grid.h" #include "nvim/memline.h" #include "nvim/mouse.h" #include "nvim/move.h" -- cgit From 51063a90df4cc8af4e1111dd50194ae487e8097e Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Tue, 16 Aug 2022 12:27:07 +0100 Subject: vim-patch:8.1.2057: the screen.c file is much too big Problem: The screen.c file is much too big. Solution: Split it in three parts. (Yegappan Lakshmanan, closes vim/vim#4943) https://github.com/vim/vim/commit/7528d1f6b5422750eb778dfb550cfd0b0e540964 This is an approximation vim-patch 8.1.2057. Applying the patch directly isn't feasible since our version of screen.c has diverged too much, however we still introduce drawscreen.c and drawline.c: - screen.c is now a much smaller file used for low level screen functions - drawline.c contains everything needed for win_line() - drawscreen.c contains everything needed for update_screen() Co-authored-by: zeertzjq --- src/nvim/mouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/mouse.c') diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index ef6f507b5c..a8d0b3b584 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -8,6 +8,7 @@ #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/diff.h" +#include "nvim/drawscreen.h" #include "nvim/fold.h" #include "nvim/grid.h" #include "nvim/memline.h" @@ -15,7 +16,6 @@ #include "nvim/move.h" #include "nvim/os_unix.h" #include "nvim/plines.h" -#include "nvim/screen.h" #include "nvim/state.h" #include "nvim/strings.h" #include "nvim/syntax.h" -- cgit