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

139212Re: [Bug] :loadview restores readonly-state

Expand Messages
  • Christian Brabandt
    Sep 18, 2013
      On Mi, 18 Sep 2013, sfx2k wrote:

      > Am Mittwoch, 18. September 2013 15:39:43 UTC+2 schrieb Ben Fritz:
      > > On Wednesday, September 18, 2013 2:18:44 AM UTC-5, sfx2k wrote:
      > > > Hey,
      > > >
      > > > it seems that there is a bug with Vim-Views.
      > > >
      > > > :mkview saves the current readonly-state of a file
      > > > :loadview restores this state
      > > >
      > > > If the fileattribute changes before opening a file, the readonly-state differs from the real fileattribute.
      > > >
      > > > You can reproduce it this way:
      > > > -file.txt is readonly
      > > > -open it in vim
      > > > -create a view with :mkview
      > > > -close the file
      > > > -change the fileattribute to readable
      > > > -open the file
      > > > -load the view with :loadview
      > > > -the file is marked as readonly but it is not!
      > > >
      > > > Imho this is a bug :)
      > > >
      > >
      > > Not a Vim bug. Vim's concept of 'readonly' is completely separate from the filesystem's concept of readonly. You can manually set 'readonly' on buffers you don't want to accidentally edit, you can set it with commands like :view and :sview, you can set it by opening a file already open in another Vim and choosing to open as read-only at the prompt, etc. There is never any indication that the 'readonly' state in Vim is because the file itself is readonly. Vim just helpfully sets that option automatically when the file itself does happen to be readonly.
      >
      > Well, it seems that I have misunderstood this option.
      > Thanks for explanation.

      BTW: You might want to tweak your 'viewoptions' settings a little bit
      (and remove the options value).

      regards,
      Christian
      --
      Wer so gut spricht, kann nichts Wahres sagen.
      -- Walter Jens

      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 4 messages in this topic