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

Re: sessions and window/buffer local variables

Expand Messages
  • Ingo Karkat
    ... What information do these window-local variables represent, and who sets and consumes them? I know of some plugins that save the ID of a
    Message 1 of 2 , Oct 25, 2012
      On 25-Oct-2012 09:29:08 +0200, Ron Aaron wrote:

      > I'm in a situation where saving the values of window-local variables
      > would be useful. It seems that "sessionoptions" does not have an
      > option for window/buffer local variables saving.
      >
      > It would be nice to generalize the 'globals' so that a local
      > window/buffer variable like "b:Saveme" would be saved with the session
      > information.

      What information do these window-local variables represent, and who sets and
      consumes them? I know of some plugins that save the ID of a
      matchadd()-highlighting in such variables. When restoring the session, this can
      wreak havoc on the plugin when the housekeeping information is restored, but the
      highlighting naturally isn't.


      On a related note, I find the various side effects of variable naming confusing
      and complex. From 'sessionoptions':

      globals global variables that start with an uppercase letter
      and contain at least one lowercase letter. Only
      String and Number types are stored.

      From 'viminfo':
      ! When included, save and restore global variables that start
      with an uppercase letter, and don't contain a lowercase
      letter. Thus "KEEPTHIS and "K_L_M" are stored, but "KeepThis"
      and "_K_L_M" are not. Only String and Number types are
      stored.

      I don't think that most plugin authors are aware of how the casing and type of
      variables affect their potential persistence. The viminfo one is special enough
      that variables must be explicitly named for it, but the sessionoptions rules
      probably include a whole lot of variables that were never meant to be persisted.

      -- regards, ingo

      --
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.