Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitea9dcc2

Browse files
committed
fix(tabpage): check if ROWS_AVAIL changed for resize
N/A patches for version.c:vim-patch:9.0.0135: comment about tabpage line above the wrong codeProblem: Comment about tabpage line above the wrong code.Solution: Move the comment. (closesvim/vim#10836)vim/vim@0b0ccbb
1 parent8ce7e74 commitea9dcc2

File tree

3 files changed

+59
-16
lines changed

3 files changed

+59
-16
lines changed

‎src/nvim/buffer_defs.h‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -947,16 +947,15 @@ struct diffblock_S {
947947
typedefstructtabpage_Stabpage_T;
948948
structtabpage_S {
949949
handle_Thandle;
950-
tabpage_T*tp_next;///< next tabpage or NULL
951-
frame_T*tp_topframe;///< topframe for the windows
952-
win_T*tp_curwin;///< current window in this Tab page
953-
win_T*tp_prevwin;///< previous window in this Tab page
954-
win_T*tp_firstwin;///< first window in this Tab page
955-
win_T*tp_lastwin;///< last window in this Tab page
956-
longtp_old_Rows;///< Rows when Tab page was left
957-
longtp_old_Columns;///< Columns when Tab page was left
958-
longtp_ch_used;///< value of 'cmdheight' when frame size
959-
///< was set
950+
tabpage_T*tp_next;///< next tabpage or NULL
951+
frame_T*tp_topframe;///< topframe for the windows
952+
win_T*tp_curwin;///< current window in this Tab page
953+
win_T*tp_prevwin;///< previous window in this Tab page
954+
win_T*tp_firstwin;///< first window in this Tab page
955+
win_T*tp_lastwin;///< last window in this Tab page
956+
longtp_old_Rows_avail;///< ROWS_AVAIL when Tab page was left
957+
longtp_old_Columns;///< Columns when Tab page was left
958+
longtp_ch_used;///< value of 'cmdheight' when frame size was set
960959

961960
diff_T*tp_first_diff;
962961
buf_T*(tp_diffbuf[DB_COUNT]);

‎src/nvim/window.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4293,7 +4293,7 @@ static int leave_tabpage(buf_T *new_curbuf, bool trigger_leave_autocmds)
42934293
tp->tp_prevwin=prevwin;
42944294
tp->tp_firstwin=firstwin;
42954295
tp->tp_lastwin=lastwin;
4296-
tp->tp_old_Rows=Rows;
4296+
tp->tp_old_Rows_avail=ROWS_AVAIL;
42974297
tp->tp_old_Columns=Columns;
42984298
firstwin=NULL;
42994299
lastwin=NULL;
@@ -4333,10 +4333,7 @@ static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, bool trigger_enter_a
43334333
constintrow=win_comp_pos();// recompute w_winrow for all windows
43344334
diff_need_scrollbind= true;
43354335

4336-
// The tabpage line may have appeared or disappeared, may need to resize
4337-
// the frames for that. When the Vim window was resized need to update
4338-
// frame sizes too. Use the stored value of p_ch, so that it can be
4339-
// different for each tab page.
4336+
// Use the stored value of p_ch, so that it can be different for each tab page.
43404337
if (p_ch!=curtab->tp_ch_used) {
43414338
clear_cmdline= true;
43424339
}
@@ -4349,7 +4346,9 @@ static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, bool trigger_enter_a
43494346
clear_cmdline= true;
43504347
}
43514348

4352-
if (curtab->tp_old_Rows!=Rows|| (old_off!=firstwin->w_winrow)) {
4349+
// The tabpage line may have appeared or disappeared, may need to resize the frames for that.
4350+
// When the Vim window was resized or ROWS_AVAIL changed need to update frame sizes too.
4351+
if (curtab->tp_old_Rows_avail!=ROWS_AVAIL|| (old_off!=firstwin->w_winrow)) {
43534352
win_new_screen_rows();
43544353
}
43554354
if (curtab->tp_old_Columns!=Columns&&starting==0) {

‎test/functional/editor/tabpage_spec.lua‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
localhelpers=require('test.functional.helpers')(after_each)
2+
localScreen=require('test.functional.ui.screen')
23

34
localclear=helpers.clear
45
localcommand=helpers.command
@@ -53,6 +54,50 @@ describe('tabpage', function()
5354
neq(999,eval('g:win_closed'))
5455
end)
5556

57+
it('no glitch when switching tabpage after setting laststatus=3 #19591',function()
58+
localscreen=Screen.new(40,10)
59+
screen:set_default_attr_ids({
60+
[0]= {bold=true,foreground=Screen.colors.Blue},
61+
[1]= {bold=true,reverse=true},-- StatusLine
62+
[2]= {reverse=true},-- StatusLineNC, TabLineFill
63+
[3]= {bold=true},-- TabLineSel
64+
[4]= {background=Screen.colors.LightGrey,underline=true},-- TabLine
65+
[5]= {bold=true,foreground=Screen.colors.Magenta},
66+
})
67+
screen:attach()
68+
69+
command('tabnew')
70+
command('tabprev')
71+
command('set laststatus=3')
72+
command('tabnext')
73+
feed('<C-G>')
74+
screen:expect([[
75+
{4: [No Name] }{3: [No Name] }{2: }{4:X}|
76+
^ |
77+
{0:~ }|
78+
{0:~ }|
79+
{0:~ }|
80+
{0:~ }|
81+
{0:~ }|
82+
{0:~ }|
83+
{1:[No Name] }|
84+
"[No Name]" --No lines in buffer-- |
85+
]])
86+
command('vnew')
87+
screen:expect([[
88+
{4: [No Name] }{3: }{5:2}{3: [No Name] }{2: }{4:X}|
89+
^ │ |
90+
{0:~ }│{0:~ }|
91+
{0:~ }│{0:~ }|
92+
{0:~ }│{0:~ }|
93+
{0:~ }│{0:~ }|
94+
{0:~ }│{0:~ }|
95+
{0:~ }│{0:~ }|
96+
{1:[No Name] }|
97+
"[No Name]" --No lines in buffer-- |
98+
]])
99+
end)
100+
56101
it(":tabmove handles modifiers and addr",function()
57102
command('tabnew | tabnew | tabnew')
58103
eq(4,funcs.nvim_tabpage_get_number(0))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp