On Tue, May 21, 2019 at 2:31 PM Jason Franklin <[email protected]> wrote: > > > Does this also fix https://github.com/vim/vim/issues/4352 I suppose not? > > No, it does not fix that issue. > > However, I'm not exactly sure that the issue referenced is a valid > complaint. It was my understanding that buffer numbers are simply id > numbers and shouldn't be relied upon for anything other than referencing > a particular buffer. The fact that the order changed shouldn't matter. > I'm not opposed to fixing this... I just don't get why it would be > important since the point of a session is to restore the views on all > of the files you were editing when the session was saved. > > Am I wrong about this?
Buffer numbers are attributed in sequence from 1 upwarts to all buffers including "hidden" and "unlisted" buffers — to all buffers opened for editing or displaying, that is, but not to sourced scripts. These numbers are attributed to the corresponding buffer when it is first opened during a session; the full list can be seen with the ":ls!" command (without the exclamation mark the so-called unlisted buffers would be omitted even though they still have an associated buffer number). Numbers of wiped buffers are voided but not made available for reuse during the same session; OTOH the :bdel command clears the buffer text but retains the buffer metadata and makes the buffer "unlisted", retaining its buffer number. So buffer numbers are usually not kept from one session to the next. Whan can be relied upon between saving a session and restarting it is the full-path-name of the editfile and AFAIK that's what :mksession uses. I don't know much about the workings of :mksession because the generated session scripts usually do much more than I need; I start vim as "gvim -S" but with a handwritten ~/Session.vim, so I have full control over what it does (and doesn't do); the :scriptnames command tells me that this script is sourced at the very end of an otherwise completely normal startup, at the VimEnter event or extremely near it AFAICT. Best regards, Tony. -- -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAJkCKXs7i5f08mY6U7eLJFvJYU9R3d3%3D5TeRXH8S1AFHNjiFSg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
