Loading ...
Sorry, an error occurred while loading the content.

Re: Way to persist custom window-specific info with :mksession?

Expand Messages
  • dagfinn
    ... I know. That s not the problem. The problem is that the identification of the remaining windows change . winnr(), that is. ... When you close a window, the
    Message 1 of 11 , Apr 2 2:39 PM
    • 0 Attachment
      On Apr 2, 11:31 pm, "A.Politz" <poli...@...> wrote:
      > dagfinn wrote:
      > >I can see that I'm having a hard time explaining what I'm really
      > >after. The problem is re-connecting the information I've saved to the
      > >right windows. The function posted by A.Politz uses winnr() to achieve
      > >this (if I've understood it correctly). I've found that approach
      > >insufficiently reliable. I would like each window to be marked with an
      > >ID that will stay constant even when windows are opened and closed.
      > >And I would like that to be saved when :mksession is run. As I
      > >mentioned, it can be done with an option, but not without interfering
      > >with something else in Vim.
      >
      > Windows have no identity, unless they are visible.
      >
      > If you close the window, it's gone, all local variables are deleted.

      I know. That's not the problem. The problem is that the identification
      of the remaining windows change . winnr(), that is.

      > You can open a new window, with the same dimensions, position and
      > buffer, but it's not the same window. Anything else would be news to
      > me.

      When you close a window, the only available ID of another window
      changes. So windows are not stably identifiable even when they're not
      explicitly changed. Somehow the window concept in Vim seems
      incomplete. But when re-loading a session, Vim re-creates windows that
      appear to the user as the same set of windows. And I'm trying to work
      with that. That may be the root cause of the problem.

      > What you experience with window-local options, are the effects of how
      > vim handles this situations. If you spit a window, it inherits the
      > setting of the other window.

      That's a weakness of my idea that I hadn't considered. It's still a
      more reliable way of identifying windows, though.

      >
      > Are you talking about buffers instead ?

      No.
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.