diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-08-29 12:48:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-29 12:48:51 +0200 |
commit | f05cc672e3b617b4480d8e2d7efc7e00863efc3d (patch) | |
tree | f5635d5e6a2a3fc1716a5d50881bcff3ddde1c20 /src/nvim/eval/funcs.c | |
parent | 253f0ffd8d4784b7fca03f8f6c2455b9ee83ff9b (diff) | |
parent | ea4e9c71ccaf406fe7aa6b47d461cdab2d6c01e9 (diff) | |
download | rneovim-f05cc672e3b617b4480d8e2d7efc7e00863efc3d.tar.gz rneovim-f05cc672e3b617b4480d8e2d7efc7e00863efc3d.tar.bz2 rneovim-f05cc672e3b617b4480d8e2d7efc7e00863efc3d.zip |
Merge pull request #19975 from bfredl/chartabsize
refactor(plines): use a struct for chartabsize state
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r-- | src/nvim/eval/funcs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 2ed9ed34f4..077a78e76e 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -849,11 +849,11 @@ static void get_col(typval_T *argvars, typval_T *rettv, bool charcol) // col(".") when the cursor is on the NUL at the end of the line // because of "coladd" can be seen as an extra column. if (virtual_active() && fp == &curwin->w_cursor) { - char_u *p = get_cursor_pos_ptr(); + char *p = (char *)get_cursor_pos_ptr(); if (curwin->w_cursor.coladd >= (colnr_T)win_chartabsize(curwin, p, curwin->w_virtcol - curwin->w_cursor.coladd)) { int l; - if (*p != NUL && p[(l = utfc_ptr2len((char *)p))] == NUL) { + if (*p != NUL && p[(l = utfc_ptr2len(p))] == NUL) { col += l; } } @@ -8537,7 +8537,7 @@ static void f_strdisplaywidth(typval_T *argvars, typval_T *rettv, EvalFuncData f col = (int)tv_get_number(&argvars[1]); } - rettv->vval.v_number = (varnumber_T)(linetabsize_col(col, (char_u *)s) - col); + rettv->vval.v_number = (varnumber_T)(linetabsize_col(col, (char *)s) - col); } /// "strwidth()" function |