Skip to content

Commit c75e812

Browse files
committed
patch 8.1.1197: when starting with multiple tabs file messages is confusing
Problem: When starting with multiple tabs file messages is confusing. Solution: Set 'shortmess' when loading the other tabs. (Christian Brabandt)
1 parent 7bde95a commit c75e812

4 files changed

Lines changed: 53 additions & 0 deletions

File tree

src/main.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2777,6 +2777,7 @@ edit_buffers(
27772777
int i;
27782778
int advance = TRUE;
27792779
win_T *win;
2780+
char_u *p_shm_save = NULL;
27802781

27812782
/*
27822783
* Don't execute Win/Buf Enter/Leave autocommands here
@@ -2812,6 +2813,17 @@ edit_buffers(
28122813
if (curtab->tp_next == NULL) /* just checking */
28132814
break;
28142815
goto_tabpage(0);
2816+
// Temporarily reset 'shm' option to not print fileinfo when
2817+
// loading the other buffers. This would overwrite the already
2818+
// existing fileinfo for the first tab.
2819+
if (i == 1)
2820+
{
2821+
char buf[100];
2822+
2823+
p_shm_save = vim_strsave(p_shm);
2824+
vim_snprintf(buf, 100, "F%s", p_shm);
2825+
set_option_value((char_u *)"shm", 0L, (char_u *)buf, 0);
2826+
}
28152827
}
28162828
else
28172829
{
@@ -2861,6 +2873,12 @@ edit_buffers(
28612873
}
28622874
}
28632875

2876+
if (p_shm_save != NULL)
2877+
{
2878+
set_option_value((char_u *)"shm", 0L, p_shm_save, 0);
2879+
vim_free(p_shm_save);
2880+
}
2881+
28642882
if (parmp->window_layout == WIN_TABS)
28652883
goto_tabpage(1);
28662884
--autocmd_no_enter;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
| +2&#ffffff0|a| | +8#0000001#e0e0e08|b| @1|c| | +1#0000000#ffffff0@64|X+8#0000001#e0e0e08
2+
> +0#0000000#ffffff0@74
3+
|~+0#4040ff13&| @73
4+
|~| @73
5+
|~| @73
6+
|~| @73
7+
|~| @73
8+
|~| @73
9+
|~| @73
10+
|~| @73
11+
|~| @73
12+
|~| @73
13+
|~| @73
14+
|~| @73
15+
|~| @73
16+
|~| @73
17+
|~| @73
18+
|~| @73
19+
|~| @73
20+
|"+0#0000000&|a|"| |[|N|e|w| |F|i|l|e|]| @42|0|,|0|-|1| @8|A|l@1|

src/testdir/test_startup.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
" Tests for startup.
22

33
source shared.vim
4+
source screendump.vim
45

56
" Check that loading startup.vim works.
67
func Test_startup_script()
@@ -547,3 +548,15 @@ func Test_issue_3969()
547548
let out = system(GetVimCommand() . ' -es -X -V1 -c "echon ''hello''" -cq')
548549
call assert_equal('hello', out)
549550
endfunc
551+
552+
func Test_start_with_tabs()
553+
if !CanRunVimInTerminal()
554+
return
555+
endif
556+
557+
let buf = RunVimInTerminal('-p a b c', {})
558+
call VerifyScreenDump(buf, 'Test_start_with_tabs', {})
559+
560+
" clean up
561+
call StopVimInTerminal(buf)
562+
endfunc

src/version.c

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

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1197,
774776
/**/
775777
1196,
776778
/**/

0 commit comments

Comments
 (0)