aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTommy Allen <tommy@esdf.io>2018-01-26 16:10:16 -0500
committerTommy Allen <tommy@esdf.io>2018-01-28 23:47:11 -0500
commitbe7990bb49d73c56a4aba6c7ce9509d116b77348 (patch)
treee34fef3d608a461ebce8440086c0459d3aeb0dde /src
parentcaf87f597febb90728288865d8df48c35c4a78e3 (diff)
downloadrneovim-be7990bb49d73c56a4aba6c7ce9509d116b77348.tar.gz
rneovim-be7990bb49d73c56a4aba6c7ce9509d116b77348.tar.bz2
rneovim-be7990bb49d73c56a4aba6c7ce9509d116b77348.zip
Use one variable for tracking adjustment instead of two
Diffstat (limited to 'src')
-rw-r--r--src/nvim/mouse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c
index 9bba165299..1e1fbe7a4d 100644
--- a/src/nvim/mouse.c
+++ b/src/nvim/mouse.c
@@ -670,8 +670,8 @@ static int mouse_adjust_click(win_T *wp, int row, int col)
vcol = offset;
-#define incr() col++; nudge++; ptr_end += utfc_ptr2len(ptr_end)
-#define decr() col--; nudge--; ptr_end -= utfc_ptr2len(ptr_end)
+#define incr() nudge++; ptr_end += utfc_ptr2len(ptr_end)
+#define decr() nudge--; ptr_end -= utfc_ptr2len(ptr_end)
while (ptr < ptr_end && *ptr != NUL) {
cwidth = chartabsize(ptr, vcol);
@@ -712,5 +712,5 @@ static int mouse_adjust_click(win_T *wp, int row, int col)
ptr += utfc_ptr2len(ptr);
}
- return col;
+ return col + nudge;
}