Skip to content

Commit e1c507a

Browse files
h-eastchrisbra
authored andcommitted
patch 9.1.1575: tabpanel not drawn correctly with wrapped lines
Problem: tabpanel not drawn correctly with wrapped lines (utubo, after v9.1.1534) Solution: Use Columns as width, not the frame width (Hirohito Higashi) fixes: #17774 closes: #17809 Signed-off-by: Hirohito Higashi <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent b201339 commit e1c507a

5 files changed

Lines changed: 45 additions & 5 deletions

File tree

src/screen.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,6 @@ char_needs_redraw(int off_from, int off_to, int cols)
366366
&& ScreenLines[off_from + 1]
367367
!= ScreenLines[off_to + 1])))))
368368
return TRUE;
369-
// TODO: This is a temporary solution until the root cause is fixed.
370-
if (firstwin->w_wincol > 0)
371-
return TRUE;
372369
return FALSE;
373370
}
374371

@@ -3691,9 +3688,9 @@ screen_ins_lines(
36913688
LineOffset[j + line_count] = temp;
36923689
LineWraps[j + line_count] = FALSE;
36933690
if (can_clear((char_u *)" "))
3694-
lineclear(temp, topframe->fr_width, clear_attr);
3691+
lineclear(temp, (int)Columns, clear_attr);
36953692
else
3696-
lineinvalid(temp, topframe->fr_width);
3693+
lineinvalid(temp, (int)Columns);
36973694
}
36983695
}
36993696

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
| +0&#ffffff0@57||+1&&|++2&&| |[|N|o| |N|a|m|e|]| @7
2+
> +0&&@57||+1&&| @18
3+
|a+0&&@2| @54||+1&&| @18
4+
|~+0#4040ff13&| @56||+1#0000000&| @18
5+
|~+0#4040ff13&| @56||+1#0000000&| @18
6+
|~+0#4040ff13&| @56||+1#0000000&| @18
7+
|~+0#4040ff13&| @56||+1#0000000&| @18
8+
|~+0#4040ff13&| @56||+1#0000000&| @18
9+
|~+0#4040ff13&| @56||+1#0000000&| @18
10+
|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@47|2|,|1| @10|A|l@1|
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
|++2&#ffffff0| |[|N|o| |N|a|m|e|]| @7||+1&&| +0&&@57
2+
| +1&&@18||> +0&&@57
3+
| +1&&@18|||a+0&&@2| @54
4+
| +1&&@18|||~+0#4040ff13&| @56
5+
| +1#0000000&@18|||~+0#4040ff13&| @56
6+
| +1#0000000&@18|||~+0#4040ff13&| @56
7+
| +1#0000000&@18|||~+0#4040ff13&| @56
8+
| +1#0000000&@18|||~+0#4040ff13&| @56
9+
| +1#0000000&@18|||~+0#4040ff13&| @56
10+
|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@47|2|,|1| @10|A|l@1|

src/testdir/test_tabpanel.vim

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,27 @@ function Test_tabpanel_drawing()
204204
call StopVimInTerminal(buf)
205205
endfunc
206206

207+
function Test_tabpanel_drawing_2()
208+
CheckScreendump
209+
210+
let lines =<< trim END
211+
set showtabpanel=2
212+
set tabpanelopt=align:right,vert
213+
call setbufline(bufnr(), 1, ['', 'aaa'])
214+
END
215+
call writefile(lines, 'XTest_tabpanel_drawing_2', 'D')
216+
217+
let buf = RunVimInTerminal('-S XTest_tabpanel_drawing_2', {'rows': 10, 'cols': 78})
218+
call term_sendkeys(buf, "ggo")
219+
call VerifyScreenDump(buf, 'Test_tabpanel_drawing_2_0', {})
220+
221+
call term_sendkeys(buf, "\<Esc>u:set tabpanelopt+=align:left\<CR>")
222+
call term_sendkeys(buf, "ggo")
223+
call VerifyScreenDump(buf, 'Test_tabpanel_drawing_2_1', {})
224+
225+
call StopVimInTerminal(buf)
226+
endfunc
227+
207228
function Test_tabpanel_drawing_with_popupwin()
208229
CheckScreendump
209230

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ static char *(features[]) =
719719

720720
static int included_patches[] =
721721
{ /* Add new patch number below this line */
722+
/**/
723+
1575,
722724
/**/
723725
1574,
724726
/**/

0 commit comments

Comments
 (0)