diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-11-22 11:02:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 11:02:24 +0100 |
commit | cd386b2c72eaacd9acac27380ee34db1accad9cb (patch) | |
tree | 15f906032e4091204450ed197da3ad97ddcb5049 /src/nvim/cursor.c | |
parent | 5eb5f4948826e9d47685ea9e257409cc3e693614 (diff) | |
parent | 40f3f75867bf03abfd90e0389a38197a00d37af1 (diff) | |
download | rneovim-cd386b2c72eaacd9acac27380ee34db1accad9cb.tar.gz rneovim-cd386b2c72eaacd9acac27380ee34db1accad9cb.tar.bz2 rneovim-cd386b2c72eaacd9acac27380ee34db1accad9cb.zip |
Merge pull request #20151 from dundargoc/refactor/char_u/13
refactor: replace char_u with char 13: remove `STRLEN` part 3
Diffstat (limited to 'src/nvim/cursor.c')
-rw-r--r-- | src/nvim/cursor.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c index 811f397cb8..84a2cf83ac 100644 --- a/src/nvim/cursor.c +++ b/src/nvim/cursor.c @@ -108,14 +108,14 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a || (VIsual_active && *p_sel != 'o') || ((get_ve_flags() & VE_ONEMORE) && wcol < MAXCOL); - char_u *line = (char_u *)ml_get_buf(curbuf, pos->lnum, false); + char *line = ml_get_buf(curbuf, pos->lnum, false); if (wcol >= MAXCOL) { - idx = (int)STRLEN(line) - 1 + one_more; + idx = (int)strlen(line) - 1 + one_more; col = wcol; if ((addspaces || finetune) && !VIsual_active) { - curwin->w_curswant = linetabsize(line) + one_more; + curwin->w_curswant = linetabsize((char_u *)line) + 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(line); + csize = linetabsize((char_u *)line); if (csize > 0) { csize--; } @@ -145,7 +145,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a } chartabsize_T cts; - init_chartabsize_arg(&cts, curwin, pos->lnum, 0, (char *)line, (char *)line); + init_chartabsize_arg(&cts, curwin, pos->lnum, 0, line, line); while (cts.cts_vcol <= wcol && *cts.cts_ptr != NUL) { // Count a tab for what it's worth (if list mode not on) csize = win_lbr_chartabsize(&cts, &head); @@ -153,7 +153,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a cts.cts_vcol += csize; } col = cts.cts_vcol; - idx = (int)(cts.cts_ptr - (char *)line); + idx = (int)(cts.cts_ptr - line); clear_chartabsize_arg(&cts); // Handle all the special cases. The virtual_active() check @@ -188,7 +188,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a col = wcol; } else { // Break a tab - int linelen = (int)STRLEN(line); + int linelen = (int)strlen(line); int correct = wcol - col - csize + 1; // negative!! char_u *newline; @@ -315,8 +315,8 @@ void check_pos(buf_T *buf, pos_T *pos) } if (pos->col > 0) { - char_u *line = (char_u *)ml_get_buf(buf, pos->lnum, false); - colnr_T len = (colnr_T)STRLEN(line); + char *line = ml_get_buf(buf, pos->lnum, false); + colnr_T len = (colnr_T)strlen(line); if (pos->col > len) { pos->col = len; } |