diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-08-11 17:38:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-11 17:38:36 +0200 |
commit | 7d2233fad007a3dd42481f8ffc01e69b57a17f9e (patch) | |
tree | a539fc5a49b000086de4a0ab7c6fbd49e8de9ab8 /src/nvim/change.c | |
parent | 2c60f7c99188e90739d83f3c131134b71cd37436 (diff) | |
parent | 28b5c73bf8b5cc92451a4030b4ffbbad6c56374b (diff) | |
download | rneovim-7d2233fad007a3dd42481f8ffc01e69b57a17f9e.tar.gz rneovim-7d2233fad007a3dd42481f8ffc01e69b57a17f9e.tar.bz2 rneovim-7d2233fad007a3dd42481f8ffc01e69b57a17f9e.zip |
Merge pull request #15336 from bfredl/plines
refactor(plines): move "plines" (size of printed lines) family of function to own file
Diffstat (limited to 'src/nvim/change.c')
-rw-r--r-- | src/nvim/change.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c index 49e403425a..41e1e3911b 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -22,6 +22,7 @@ #include "nvim/misc1.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/plines.h" #include "nvim/screen.h" #include "nvim/search.h" #include "nvim/state.h" @@ -593,9 +594,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 + chartabsize(buf, vcol); + colnr_T new_vcol = vcol + win_chartabsize(curwin, buf, vcol); while (oldp[col + oldlen] != NUL && vcol < new_vcol) { - vcol += chartabsize(oldp + col + oldlen, vcol); + vcol += win_chartabsize(curwin, 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) { |