diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-08-27 11:28:11 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2022-08-29 12:05:34 +0200 |
commit | ea4e9c71ccaf406fe7aa6b47d461cdab2d6c01e9 (patch) | |
tree | d8c14449741cdfcbf3fcb65d518a7ee0a15a70bb /src/nvim/change.c | |
parent | 7a9b5937966d3db852c84b8eb232e77d92d3c355 (diff) | |
download | rneovim-ea4e9c71ccaf406fe7aa6b47d461cdab2d6c01e9.tar.gz rneovim-ea4e9c71ccaf406fe7aa6b47d461cdab2d6c01e9.tar.bz2 rneovim-ea4e9c71ccaf406fe7aa6b47d461cdab2d6c01e9.zip |
refactor(plines): use a struct for chartabsize state
This is a refactor extracted from vim-patch 9.0.0067: cannot show virtual text
The logic for inline virtual text is going to be different in nvim than
text property based text in vim, but this refactor is still useful,
as calculation of displayed linesize is going to be stateful in a
similar way.
Diffstat (limited to 'src/nvim/change.c')
-rw-r--r-- | src/nvim/change.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c index 04dfb20a1b..074700f4df 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -653,9 +653,9 @@ void ins_char_bytes(char_u *buf, size_t charlen) // cells. May result in adding spaces to fill a gap. colnr_T vcol; getvcol(curwin, &curwin->w_cursor, NULL, &vcol, NULL); - colnr_T new_vcol = vcol + win_chartabsize(curwin, buf, vcol); + colnr_T new_vcol = vcol + win_chartabsize(curwin, (char *)buf, vcol); while (oldp[col + oldlen] != NUL && vcol < new_vcol) { - vcol += win_chartabsize(curwin, oldp + col + oldlen, vcol); + vcol += win_chartabsize(curwin, (char *)oldp + col + oldlen, vcol); // Don't need to remove a TAB that takes us to the right // position. if (vcol > new_vcol && oldp[col + oldlen] == TAB) { |