On Do, 18 Apr 2019, Bram Moolenaar wrote:

> I don't like this solution, if there is an error then some part of the
> information has gone missing.

Probably true.
> 
> A better solution would be to load the buffer in what will be the
> current tab last.

I tried that, but I fear that would require a bigger refactoring, since 
loading of the initial buffer is done earlier in command_line_scan()

So how about just temporarily resetting the shm option when loading the 
other tabs. We will switch back to the initial tab in edit_buffers() 
anyhow, so why printing the fileinfo() at all?

diff --git a/src/main.c b/src/main.c
index 5edcbdf8f..a59bc2109 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2777,6 +2777,7 @@ edit_buffers(
     int                i;
     int                advance = TRUE;
     win_T      *win;
+    char_u     *p_shm_save = NULL;

     /*
      * Don't execute Win/Buf Enter/Leave autocommands here
@@ -2812,6 +2813,14 @@ edit_buffers(
                if (curtab->tp_next == NULL)    /* just checking */
                    break;
                goto_tabpage(0);
+               // temporarily reset 'shm' option to not print fileinfo
+               // when loading the other buffers. This will overwrite the
+               // already existing fileinfo
+               if (i == 1)
+               {
+                   p_shm_save = vim_strsave(p_shm);
+                   set_option_value((char_u *)"shm", 0L, (char_u *)"F", 0);
+               }
            }
            else
            {
@@ -2862,7 +2871,11 @@ edit_buffers(
     }

     if (parmp->window_layout == WIN_TABS)
+    {
+       set_option_value((char_u *)"shm", 0L, p_shm_save, 0);
+       vim_free(p_shm_save);
        goto_tabpage(1);
+    }
     --autocmd_no_enter;

     /* make the first window the current window */


Best,
Christian
-- 
Wir tun nichts und reden entsetzlich viel.
                -- Maxim Gorkij

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui