[vim/vim] Empty first tab lost when using sessions (#1282)

45 views
Skip to first unread message

Jim Stewart

unread,
Nov 25, 2016, 10:41:46 AM11/25/16
to vim/vim

I'm creating a session with mksession, and when I restore the session, if the first tab was empty ([No Name]), it's gone in the restored session. Other empty tabs are restored fine; it seems to only be the first tab that's lost. If there are multiple "leading" empty tabs, it's still only the first one that disappears.

I'm using this with vim -u NONE so there is zero config and no plugins, but I get the same behavior with my normal config. Affects versions 7.3 and 8.0.52.

I'm using the default sessionoptions in all cases: blank,buffers,curdir,folds,options,tabpages,winsize.

Steps to reproduce:

  • $ vim -u NONE
  • :tabnew
  • :e foo.txt
  • :w
  • :tabnew
  • :mksession
  • :qa
  • $ vim -u NONE -S Session.vim

The tabline now shows foo.txt | [No Name]. Expected [No Name] | foo.txt | [No Name].


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

h_east

unread,
Nov 25, 2016, 12:50:23 PM11/25/16
to vim_dev, v...@noreply.github.com, reply+00b1d19800a721a4c31e8001568501bca78c7e9...@reply.github.com, vim-dev...@256bit.org
Hi Jim!

2016-11-26(Sat) 0:41:46 UTC+9 Jim Stewart:


> I'm creating a session with mksession, and when I restore the session, if the first tab was empty ([No Name]), it's gone in the restored session. Other empty tabs are restored fine; it seems to only be the first tab that's lost. If there are multiple "leading" empty tabs, it's still only the first one that disappears.
>
> I'm using this with vim -u NONE so there is zero config and no plugins, but I get the same behavior with my normal config. Affects versions 7.3 and 8.0.52.
>
> I'm using the default sessionoptions in all cases: blank,buffers,curdir,folds,options,tabpages,winsize.
>
> Steps to reproduce:
>
> $ vim -u NONE
> :tabnew
> :e foo.txt
> :w
> :tabnew
> :mksession
> :qa
> $ vim -u NONE -S Session.vim
>
>
> The tabline now shows foo.txt | [No Name]. Expected [No Name] | foo.txt | [No Name].

I can reproduce it.
And I wrote a patch for this issue. (Attached)
Could you please check this patch?
When issue has been resolved, I'll add a test later.

--
Best regards,
Hirohito Higashi (a.k.a. h_east)

fix_mksession_with_empty_first_tabpage.patch

vim-dev ML

unread,
Nov 25, 2016, 12:50:49 PM11/25/16
to vim/vim, vim-dev ML, Your activity
Hi Jim!

2016-11-26(Sat) 0:41:46 UTC+9 Jim Stewart:
> I'm creating a session with mksession, and when I restore the session, if the first tab was empty ([No Name]), it's gone in the restored session. Other empty tabs are restored fine; it seems to only be the first tab that's lost. If there are multiple "leading" empty tabs, it's still only the first one that disappears.
>
> I'm using this with vim -u NONE so there is zero config and no plugins, but I get the same behavior with my normal config. Affects versions 7.3 and 8.0.52.
>
> I'm using the default sessionoptions in all cases: blank,buffers,curdir,folds,options,tabpages,winsize.
>
> Steps to reproduce:
>
> $ vim -u NONE
> :tabnew
> :e foo.txt
> :w
> :tabnew
> :mksession
> :qa
> $ vim -u NONE -S Session.vim
>
>
> The tabline now shows foo.txt | [No Name]. Expected [No Name] | foo.txt | [No Name].

I can reproduce it.
And I wrote a patch for this issue. (Attached)
Could you please check this patch?
When issue has been resolved, I'll add a test later.

--
Best regards,
Hirohito Higashi (a.k.a. h_east)

vim-dev ML

unread,
Nov 25, 2016, 3:40:52 PM11/25/16
to vim/vim, vim-dev ML, Your activity
> I can reproduce it.
> And I wrote a patch for this issue. (Attached)
> Could you please check this patch?
> When issue has been resolved, I'll add a test later.

This patch fixes it for me, with 8.0.52. I'm not familiar with the Vim source, but if there's anything I can do to help, please let me know.

Thanks you!

-Jim

Jim Stewart

unread,
Nov 25, 2016, 4:42:41 PM11/25/16
to vim_dev, v...@noreply.github.com, reply+00b1d19800a721a4c31e8001568501bca78c7e9...@reply.github.com, vim-dev...@256bit.org
> I can reproduce it.
> And I wrote a patch for this issue. (Attached)
> Could you please check this patch?
> When issue has been resolved, I'll add a test later.

h_east

unread,
Nov 25, 2016, 11:21:19 PM11/25/16
to vim_dev, v...@noreply.github.com, vim-dev...@256bit.org, your_a...@noreply.github.com, reply+00b1d198221a7be2f680e87c7a49e9195321a65...@reply.github.com
Hi Jim and list,

2016-11-26(Sat) 5:40:52 UTC+9 vim-dev ML:


> > I can reproduce it.
>
> > And I wrote a patch for this issue. (Attached)
>
> > Could you please check this patch?
>
> > When issue has been resolved, I'll add a test later.
>
>
>
> This patch fixes it for me, with 8.0.52. I'm not familiar with the Vim source, but if there's anything I can do to help, please let me know.
>
>
>
> Thanks you!

Ah, this patch is bad solution.
I rewrote a patch that respect the following description of the document.

:help :mksession
doc> 8. Restores all windows with the same layout. If 'sessionoptions' contains
doc> "help", help windows are restored. If 'sessionoptions' contains "blank",
doc> windows editing a buffer without a name will be restored.

That is, when 'sessionoptions' contains 'blank', then also restores the empty window.

fix_mksession_with_empty_first_tabpage.patch

vim-dev ML

unread,
Nov 25, 2016, 11:21:42 PM11/25/16
to vim/vim, vim-dev ML, Your activity

Yee Cheng Chin

unread,
Jul 4, 2018, 5:26:49 PM7/4/18
to vim/vim, vim-dev ML, Comment

Hi, this is an old bug but I just submitted a pull request (#3152) that fixes another issue with mksession
(it doesn't respect local directories properly with multiple tabs) and I fixed this issue as well. It's been merged in (26d4b89) so I believe this issue can be close if you can verify it.


You are receiving this because you commented.

Christian Brabandt

unread,
Jul 13, 2018, 5:30:23 PM7/13/18
to vim/vim, vim-dev ML, Comment

can no longer reproduce as of 8.1.179
closing.


You are receiving this because you commented.

Christian Brabandt

unread,
Jul 13, 2018, 5:30:23 PM7/13/18
to vim/vim, vim-dev ML, Comment

Closed #1282.


You are receiving this because you commented.

Reply all
Reply to author
Forward
0 new messages