diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/cursor.c | 4 | ||||
-rw-r--r-- | src/nvim/normal.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c index 2dc903309e..418d49dfeb 100644 --- a/src/nvim/cursor.c +++ b/src/nvim/cursor.c @@ -115,7 +115,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a col = wcol; if ((addspaces || finetune) && !VIsual_active) { - curwin->w_curswant = linetabsize_str(line) + one_more; + curwin->w_curswant = (int)linetabsize(curwin, pos->lnum) + one_more; if (curwin->w_curswant > 0) { curwin->w_curswant--; } @@ -129,7 +129,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a && curwin->w_width_inner != 0 && wcol >= (colnr_T)width && width > 0) { - csize = linetabsize_str(line); + csize = (int)linetabsize(curwin, pos->lnum); if (csize > 0) { csize--; } diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 82b930d2ff..0764cbec7a 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -2471,7 +2471,7 @@ bool find_decl(char *ptr, size_t len, bool locally, bool thisblock, int flags_ar /// @return true if able to move cursor, false otherwise. static bool nv_screengo(oparg_T *oap, int dir, long dist) { - int linelen = linetabsize_str(get_cursor_line_ptr()); + int linelen = (int)linetabsize(curwin, curwin->w_cursor.lnum); bool retval = true; bool atend = false; int col_off1; // margin offset for first screen line @@ -2535,7 +2535,7 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist) } cursor_up_inner(curwin, 1); - linelen = linetabsize_str(get_cursor_line_ptr()); + linelen = (int)linetabsize(curwin, curwin->w_cursor.lnum); if (linelen > width1) { int w = (((linelen - width1 - 1) / width2) + 1) * width2; assert(curwin->w_curswant <= INT_MAX - w); @@ -2568,7 +2568,7 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist) if (curwin->w_curswant >= width1) { curwin->w_curswant -= width2; } - linelen = linetabsize_str(get_cursor_line_ptr()); + linelen = (int)linetabsize(curwin, curwin->w_cursor.lnum); } } } @@ -5492,7 +5492,7 @@ static void nv_g_cmd(cmdarg_T *cap) case 'M': oap->motion_type = kMTCharWise; oap->inclusive = false; - i = linetabsize_str(get_cursor_line_ptr()); + i = (int)linetabsize(curwin, curwin->w_cursor.lnum); if (cap->count0 > 0 && cap->count0 <= 100) { coladvance((colnr_T)(i * cap->count0 / 100)); } else { |