If a_session
is created via :mksession
, when reopening that session via vim -S a_session
, Vim doesn't take into account that file permissions of some of the opened files might have changed in the meanwhile.
Here are the repro steps.
- Open
a_file
which is not readonly, and make sure that's the case by verifying:echo &readonly
gives0
; - save the session,
:mksession
; - close Vim,
:q
; - in the terminal, make the file readonly
chmod -w a_file
; - reopen Vim via
vim -S Session.vim
; - verify that
:echo &readonly
still returns0
, which I find strange - run
:e
- verify that
:echo &readonly
returns1
now.
Is what happens at step 6 by design?