Consider the following test sequence...
:new
:ls
  1 #a   "[No Name]"                    line 1
  2 %a   "[No Name]"                    line 1
:hide
:ls
  1 %a   "[No Name]"                    line 1
  2  h   "[No Name]"                    line 0
:new somefile.txt
:ls
  1 #a   "[No Name]"                    line 1
  2  h   "[No Name]"                    line 0
  3 %a   "somefile.txt"                 line 1

As expected, the empty [No Name] buffer created with :new was hidden by the :hide command and remains in the buffer list. I can get it back in its own window by executing...
:sb 2

Now consider the following variation on the test sequence above...
:new
:ls
  1 #a   "[No Name]"                    line 1
  2 %a   "[No Name]"                    line 1
:hide e somefile.txt
:ls
  1  a   "[No Name]"                    line 1
  2 %a   "somefile.txt"                 line 1

Notice that the [No Name] buffer that used to be buffer 2 is now gone, apparently replaced by somefile.txt. I can't possibly get it back. I know it was discarded (and not simply reassigned the name somefile.txt) because any buffer-local variables it contained are not accessible in the somefile.txt buffer.

It seems to me that the 2 test cases above should produce similar results. In particular, I would expect that executing...
:sb 2
...at the end of the second sequence would restore to its own window the [No Name] buffer hidden by...
:hide e somefile.txt

Is this a bug, or is the behavior described somewhere in the documentation?

Thanks,
Brett Stahlman

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to