aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/screen.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-28 13:40:34 -0400
committerGitHub <noreply@github.com>2021-03-28 13:40:34 -0400
commit63c2a7af2da3998167c7b1b06fb461b20b144c78 (patch)
tree77aa1b22e65a65c62fa4a062bb88945e02f5d5ca /src/nvim/screen.c
parent6d4a922e07e857b46d882ea96decce7c7c6e2a30 (diff)
parenta70d904ad0e2037c7fb2ae10a20f840af3544496 (diff)
downloadrneovim-63c2a7af2da3998167c7b1b06fb461b20b144c78.tar.gz
rneovim-63c2a7af2da3998167c7b1b06fb461b20b144c78.tar.bz2
rneovim-63c2a7af2da3998167c7b1b06fb461b20b144c78.zip
Merge pull request #13851 from VVKot/vim-8.1.0105
vim-patch:8.1.{0105,0114,0116,0126,0138,0154,0479,0542,0936}
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r--src/nvim/screen.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 749627de80..7c71a440af 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -3441,8 +3441,8 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow,
// TODO: is passing p for start of the line OK?
n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol, NULL) - 1;
if (c == TAB && n_extra + col > grid->Columns) {
- n_extra = (int)wp->w_buffer->b_p_ts
- - vcol % (int)wp->w_buffer->b_p_ts - 1;
+ n_extra = tabstop_padding(vcol, wp->w_buffer->b_p_ts,
+ wp->w_buffer->b_p_vts_array) - 1;
}
c_extra = mb_off > 0 ? MB_FILLER_CHAR : ' ';
c_final = NUL;
@@ -3508,8 +3508,9 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow,
vcol_adjusted = vcol - MB_CHARLEN(p_sbr);
}
// tab amount depends on current column
- tab_len = (int)wp->w_buffer->b_p_ts
- - vcol_adjusted % (int)wp->w_buffer->b_p_ts - 1;
+ tab_len = tabstop_padding(vcol_adjusted,
+ wp->w_buffer->b_p_ts,
+ wp->w_buffer->b_p_vts_array) - 1;
if (!wp->w_p_lbr || !wp->w_p_list) {
n_extra = tab_len;
@@ -3542,6 +3543,10 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow,
xfree(p_extra_free);
p_extra_free = p;
for (i = 0; i < tab_len; i++) {
+ if (*p == NUL) {
+ tab_len = i;
+ break;
+ }
int lcs = wp->w_p_lcs_chars.tab2;
// if tab3 is given, need to change the char