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

Re: [patch] Unsetting swapfiles removes all swapfiles

Expand Messages
  • Andy Wokula
    ... You re right, I have actually faced this /confusion/ too. I ve even thrown a script at the issue (see attachment)! You do ... (e.g. :ForceSet swapfile) to
    Message 1 of 5 , Oct 16, 2012
    • 0 Attachment
      Am 16.10.2012 20:18, schrieb Christian Brabandt:
      > Hi Andy!
      > On Di, 16 Okt 2012, Andy Wokula wrote:
      >> Am 16.10.2012 18:00, schrieb Christian Brabandt:> Bram,
      >>> when doing :setglobal noswapfile, Vim incorrectly does not delete all
      >>> swapfiles. Also, if you have disabled swapfiles, :setglobal swapfile
      >>> won't create swapfiles for all loaded buffers.
      >>> Attached patch fixes it.
      >> Why is that a bug?
      >> The 'swapfile' option is "local to buffer" which means the global value
      >> is only used for *new* buffers.
      > This means, when globally enabling undofiles, all loaded buffers
      > shouldn't try to read their undofiles, because their local value is
      > still disabled.
      > This is really confusing.

      You're right, I have actually faced this /confusion/ too.

      I've even thrown a script at the issue (see attachment)! You do
      :ForceSet {set-arg} ...
      (e.g. :ForceSet swapfile)
      to set certain options whenever a buffer is visited, and
      :NoForceSet [set-arg] ...
      to turn these actions off.
      So to say, it operates in a `lazy' (not `eager') manner ...

      prints the enabled set commands, and
      (without arguments) removes all actions.

      (Detail: It's clever enough to not accumulate actions for the same
      option (nu, nonu, invnu, nu!, ...) but it's not aware of long and short
      option names (nu, number)).

      (Didn't check if it actually works for 'swapfile' and 'undofile')


      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.