aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mouse.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-08-10 23:18:12 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2021-08-10 23:18:12 +0200
commitac56a27a108012b80f5ed61be7370f10bbeb9d41 (patch)
tree7783e8b69f30cff08abdfb4d5e235147c3ba7778 /src/nvim/mouse.c
parentb506643dfc5800255717e2c7ccb7934214126b31 (diff)
downloadrneovim-ac56a27a108012b80f5ed61be7370f10bbeb9d41.tar.gz
rneovim-ac56a27a108012b80f5ed61be7370f10bbeb9d41.tar.bz2
rneovim-ac56a27a108012b80f5ed61be7370f10bbeb9d41.zip
refactor(plines): remove implicit curwin chartabsize() function
Diffstat (limited to 'src/nvim/mouse.c')
-rw-r--r--src/nvim/mouse.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c
index 0864dad27d..c46222460b 100644
--- a/src/nvim/mouse.c
+++ b/src/nvim/mouse.c
@@ -525,7 +525,7 @@ static colnr_T scroll_line_len(linenr_T lnum)
char_u *line = ml_get(lnum);
if (*line != NUL) {
for (;;) {
- int numchar = chartabsize(line, col);
+ int numchar = win_chartabsize(curwin, line, col);
MB_PTR_ADV(line);
if (*line == NUL) { // don't count the last character
break;
@@ -621,7 +621,7 @@ static int mouse_adjust_click(win_T *wp, int row, int col)
// scanned *up to* `col`, nudging it left or right when concealed characters
// are encountered.
//
- // chartabsize() is used to keep track of the virtual column position relative
+ // win_chartabsize() is used to keep track of the virtual column position relative
// to the line's bytes. For example: if col == 9 and the line starts with a
// tab that's 8 columns wide, we would want the cursor to be highlighting the
// second byte, not the ninth.
@@ -648,7 +648,7 @@ static int mouse_adjust_click(win_T *wp, int row, int col)
// checked for concealed characters.
vcol = 0;
while (vcol < offset && *ptr != NUL) {
- vcol += chartabsize(ptr, vcol);
+ vcol += win_chartabsize(curwin, ptr, vcol);
ptr += utfc_ptr2len(ptr);
}
@@ -659,7 +659,7 @@ static int mouse_adjust_click(win_T *wp, int row, int col)
vcol = offset;
ptr_end = ptr_row_offset;
while (vcol < col && *ptr_end != NUL) {
- vcol += chartabsize(ptr_end, vcol);
+ vcol += win_chartabsize(curwin, ptr_end, vcol);
ptr_end += utfc_ptr2len(ptr_end);
}
@@ -674,7 +674,7 @@ static int mouse_adjust_click(win_T *wp, int row, int col)
#define decr() nudge--; ptr_end -= utfc_ptr2len(ptr_end)
while (ptr < ptr_end && *ptr != NUL) {
- cwidth = chartabsize(ptr, vcol);
+ cwidth = win_chartabsize(curwin, ptr, vcol);
vcol += cwidth;
if (cwidth > 1 && *ptr == '\t' && nudge > 0) {
// A tab will "absorb" any previous adjustments.