You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Occasionally when I am editing a file, the whole folder containing the file is moved to another place. This makes the buffer being edited loss its underlying file. Then I will want to move the buffer to the new place.
A simple :saveas! newplace will not work perfectly since the old buffer will still be a listed buffer. Now I come across this very helpful plugin and try to use Move to achieve the goal. However, I found the Move doesn't work either since the source file is already deleted and it ends up with an error msg Failed to rename ..., see definition for command Move.
To reproduce the error, simply enter an empty folder and type vim a and then in vim do :Move b. Since at this time there is no file named a in the file system, the Move is not allowed.
A tried the following solution and it seems to work. It just checks whether the source still exists before perform the real moving. Would you please review the code or give some other suggestions? I can also create the pull request if you feel acceptable. Thank you very much.
Occasionally when I am editing a file, the whole folder containing the file is moved to another place. This makes the buffer being edited loss its underlying file. Then I will want to move the buffer to the new place.
A simple
:saveas! newplace
will not work perfectly since the old buffer will still be a listed buffer. Now I come across this very helpful plugin and try to useMove
to achieve the goal. However, I found theMove
doesn't work either since the source file is already deleted and it ends up with an error msgFailed to rename ...
, see definition for commandMove
.To reproduce the error, simply enter an empty folder and type
vim a
and then in vim do:Move b
. Since at this time there is no file nameda
in the file system, theMove
is not allowed.A tried the following solution and it seems to work. It just checks whether the source still exists before perform the real moving. Would you please review the code or give some other suggestions? I can also create the pull request if you feel acceptable. Thank you very much.
The text was updated successfully, but these errors were encountered: