vim Acommand from shell
Edit the file
Ain some way (now
&modified == 1)
:Lexplore†1 to enable the side pane of netrw
Press Enter on an arbitary file
, the file
B is opened in the window in which
A was opened without any prompt and, as a result, the modification to
A is totally lost.
Is this an expected behavior? How can I get along with this buggy behavior?
†1: Edit: it turns out the problem is not specific to
:Lexplore command. Netrw opened via
:e also shows the behavior.
I suspect the behavior is unexpected (i.e. a bug). I'm debugging
netrw according to the instructions found in
:help netrw and have located the cause;
e! is called in
autoload/netrw.vim. Just replacing two
e solved the discarding behavior. But I still have to keep analyzing the code to know what kind of side effects will happen if
e! is replaced with
e and the operation fails due to
&modified == 1.
Now I'm using a minimal
.vimrc which has only the following two lines.
set nocp filetype plugin on
I could reproduce the problem under multiple environments.