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

Bug - :wa! behaviour

Expand Messages
  • Vince Negri
    Just noticed this... the docs say ... Buffers without a file name are not written. However, if I make changes to a number of read-only buffers, and try to
    Message 1 of 4 , Nov 29, 2000
    • 0 Attachment
      Just noticed this... the docs say

      :wa[ll]! Write all changed buffers, even the ones that are readonly.
      Buffers without a file name are not written.

      However, if I make changes to a number of read-only buffers, and try
      to :wa!, I get the message "<buffer> is read-only" for each of them,
      and irritatingly it tells me to use "!"

      "But I *did*!!" I think at this point. It appears that ":wa!" is no
      different from ":wa".

      A related issue- if I ":w!" on a single modified readonly file, it
      saves ok, but the "[RO]" disappears from the statusline.. yet
      the file is _still_ readonly, and a further ":w" attempt fails.
      I have a feeling 5.7 behaved differently??

      --
      Vince Negri (vnegri@...)
      Application Solutions Ltd. Tel:+44(0)1273-476608 Fax:+44(0)1273-478888

      Legal Disclaimer: Any views expressed by the sender of this message are
      not necessarily those of Application Solutions Ltd. Information in this
      e-mail may be confidential and is for the use of the intended recipient
      only, no mistake in transmission is intended to waive or compromise such
      privilege. Please advise the sender if you receive this e-mail by mistake.
    • Bram Moolenaar
      ... Hmm, for me it works as the docs say. What is different in your setup? Which version of Vim? ... For me the readonly option is reset, but the status
      Message 2 of 4 , Nov 29, 2000
      • 0 Attachment
        Vince Negri wrote:

        > Just noticed this... the docs say
        >
        > :wa[ll]! Write all changed buffers, even the ones that are readonly.
        > Buffers without a file name are not written.
        >
        > However, if I make changes to a number of read-only buffers, and try
        > to :wa!, I get the message "<buffer> is read-only" for each of them,
        > and irritatingly it tells me to use "!"
        >
        > "But I *did*!!" I think at this point. It appears that ":wa!" is no
        > different from ":wa".

        Hmm, for me it works as the docs say. What is different in your setup?
        Which version of Vim?

        > A related issue- if I ":w!" on a single modified readonly file, it
        > saves ok, but the "[RO]" disappears from the statusline.. yet
        > the file is _still_ readonly, and a further ":w" attempt fails.
        > I have a feeling 5.7 behaved differently??

        For me the 'readonly' option is reset, but the status line isn't redrawn.
        I'll fix the redrawing. For me the next ":w" doesn't complain, I would not
        know why it does for you...

        --
        Overflow on /dev/null, please empty the bit bucket.

        /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
        \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
      • Vince Negri
        ... 6.0n on Win32 console. What happens is that the ! allows the first read-only check to be passed, but there is an additional check in buf_write_all()...
        Message 3 of 4 , Nov 29, 2000
        • 0 Attachment
          > > However, if I make changes to a number of read-only buffers, and try
          > > to :wa!, I get the message "<buffer> is read-only" for each of them,
          > > and irritatingly it tells me to use "!"
          > >
          > > "But I *did*!!" I think at this point. It appears that ":wa!" is no
          > > different from ":wa".

          > Hmm, for me it works as the docs say. What is different in your setup?
          > Which version of Vim?

          6.0n on Win32 console. What happens is that the ! allows
          the first read-only check to be passed, but there is an additional
          check in buf_write_all()... this was introduced as I recall
          to guard against a file being made read-only behind Vim's back.
          Anyhow the eap->forceit was not passed down into buf_write_all(),
          that's what my patch fixed.



          Legal Disclaimer: Any views expressed by the sender of this message are
          not necessarily those of Application Solutions Ltd. Information in this
          e-mail may be confidential and is for the use of the intended recipient
          only, no mistake in transmission is intended to waive or compromise such
          privilege. Please advise the sender if you receive this e-mail by mistake.
        • Bram Moolenaar
          ... OK, I now understand what you were doing: The file itself was read-only. I tried with the readonly option set, that s not the same. I ll include your
          Message 4 of 4 , Nov 29, 2000
          • 0 Attachment
            Vince Negri wrote:

            > > > However, if I make changes to a number of read-only buffers, and try
            > > > to :wa!, I get the message "<buffer> is read-only" for each of them,
            > > > and irritatingly it tells me to use "!"
            > > >
            > > > "But I *did*!!" I think at this point. It appears that ":wa!" is no
            > > > different from ":wa".
            >
            > > Hmm, for me it works as the docs say. What is different in your setup?
            > > Which version of Vim?
            >
            > 6.0n on Win32 console. What happens is that the ! allows
            > the first read-only check to be passed, but there is an additional
            > check in buf_write_all()... this was introduced as I recall
            > to guard against a file being made read-only behind Vim's back.
            > Anyhow the eap->forceit was not passed down into buf_write_all(),
            > that's what my patch fixed.

            OK, I now understand what you were doing: The file itself was read-only. I
            tried with the 'readonly' option set, that's not the same.

            I'll include your patch, thanks!

            --
            GUARD #1: Where'd you get the coconut?
            ARTHUR: We found them.
            GUARD #1: Found them? In Mercea? The coconut's tropical!
            ARTHUR: What do you mean?
            GUARD #1: Well, this is a temperate zone.
            The Quest for the Holy Grail (Monty Python)

            /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
            \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
          Your message has been successfully submitted and would be delivered to recipients shortly.