When I
Execute
vim A
command from shellEdit the file
A
in some way (now&modified == 1
)Execute
:Lexplore
†1 to enable the side pane of netrwPress Enter on an arbitary file
B
, 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 :Explore
or :e
also shows the behavior.
Current Status
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!
with 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
.
.vimrc
Now I'm using a minimal .vimrc
which has only the following two lines.
set nocp
filetype plugin on
Environments
I could reproduce the problem under multiple environments.
:Lexplore
and it discards the changes inA
when I openB
. I upgraded to latest netrw from Dr. Chip's website (netrw v170c from March 30, 2020) and I can still reproduce it. Where is thee!
you said causes it? Which function?README.md
, the patch should work.:help netrw
page (remove the NOSPAM letters from the address there...)170f
. Again, thank you for your suggestion.