On 5/23/06, Zdenek Sekera <[EMAIL PROTECTED]> wrote:
> create a file ~/.vimtest as follows:
>
> cat > .vimtest
> set nocompatible
> set readonly
> <C-D>
>
> and execute (g)vim:
>
> vim .vimtest -u .vimtest
>
> try :set readonly? and you'll get 'noreadonly'.
The buffer does exist when initfile is executed. The ':ls' in initfile shows it.
Adding more printouts to initfile shows interesting results:
vim -u 1 1
----------------- file called 1 ---------------
set nocompatible
ls
call input('before set readonly 111')
set readonly
set readonly?
ls
set readonly?
set readonly?
echo "&readonly=".&readonly
call input('after set readonly 222')
-----------------------------------------------------
In vim, ':verb set readonly?' shows that readonly is misteriously reset.
The output differs between vim6 and vim7.
--------------- vim7 output ------------------
1 % "1" line 1
before set readonly 111
1 % = "1" line 1
&readonly=1
after set readonly 222
----------------------------------------
Note the missing output of ':set readonly?'!!! It prints neither
'readonly' nor 'noreadonly'.
----------------- vim6 output --------------------
1 % "1" line 1
before set readonly 111
before set readonly 111
1 % = "1" line 1
readonly
readonly
&readonly=1
after set readonly 222
-----------------------------------------------------
Looks like a bug to me.
Yakov