{"action":"created","issue":{"url":"https://api.github.com/repos/chrisbra/Recover.vim/issues/38","labels_url":"https://api.github.com/repos/chrisbra/Recover.vim/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/chrisbra/Recover.vim/issues/38/comments","events_url":"https://api.github.com/repos/chrisbra/Recover.vim/issues/38/events","html_url":"https://github.com/chrisbra/Recover.vim/issues/38","id":102394828,"number":38,"title":"recover#RecoverFinish() does not delete swap file","user":{"login":"PhilRunninger","id":5598066,"avatar_url":"https://avatars.githubusercontent.com/u/5598066?v=3","gravatar_id":"","url":"https://api.github.com/users/PhilRunninger","html_url":"https://github.com/PhilRunninger","followers_url":"https://api.github.com/users/PhilRunninger/followers","following_url":"https://api.github.com/users/PhilRunninger/following{/other_user}","gists_url":"https://api.github.com/users/PhilRunninger/gists{/gist_id}","starred_url":"https://api.github.com/users/PhilRunninger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhilRunninger/subscriptions","organizations_url":"https://api.github.com/users/PhilRunninger/orgs","repos_url":"https://api.github.com/users/PhilRunninger/repos","events_url":"https://api.github.com/users/PhilRunninger/events{/privacy}","received_events_url":"https://api.github.com/users/PhilRunninger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-21T14:43:37Z","updated_at":"2015-08-21T20:58:18Z","closed_at":null,"body":"In my [vimrc](https://github.com/PhilRunninger/my_vim_setup), I have the `set directory=$VIMHOME/tmp/swapfiles//` statement to keep my development folders clear of swap files. I am running vim 7.4.712 on MacOSX. After vim crashes, my preferred choice is to use the `Diff` in your plugin to examine the differences. When I'm done, using either `:RecoverPluginFinish` or `:RecoverPluginGet`, I think all is well. That is, until I edit the file again, and I go through the same operation. I traced it down to the `call delete(fnameescape(swapname))` statement in `recover#RecoverFinish()`. The `delete()` function is returning a -2. \r\n\r\nAt the time the error occurred, the value of swapname is `/Users/prunninger/.vim/tmp/swapfiles//%Users%prunninger%junk%foo.txt.swp`, which `fnameescape` changes to `/Users/prunninger/.vim/tmp/swapfiles//\\%Users\\%prunninger\\%junk\\%foo.txt.swp`.\r\n\r\nAs I stated in my [StackOverflow](http://stackoverflow.com/questions/32142247/what-are-the-vimscript-delete-function-return-codes-and-their-meanings) question, I suspect bad escaping, pointing to a nonexistent file, rather than a permission issue."},"comment":{"url":"https://api.github.com/repos/chrisbra/Recover.vim/issues/comments/133562276","html_url":"https://github.com/chrisbra/Recover.vim/issues/38#issuecomment-133562276","issue_url":"https://api.github.com/repos/chrisbra/Recover.vim/issues/38","id":133562276,"user":{"login":"vim-ml","id":11653528,"avatar_url":"https://avatars.githubusercontent.com/u/11653528?v=3","gravatar_id":"","url":"https://api.github.com/users/vim-ml","html_url":"https://github.com/vim-ml","followers_url":"https://api.github.com/users/vim-ml/followers","following_url":"https://api.github.com/users/vim-ml/following{/other_user}","gists_url":"https://api.github.com/users/vim-ml/gists{/gist_id}","starred_url":"https://api.github.com/users/vim-ml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vim-ml/subscriptions","organizations_url":"https://api.github.com/users/vim-ml/orgs","repos_url":"https://api.github.com/users/vim-ml/repos","events_url":"https://api.github.com/users/vim-ml/events{/privacy}","received_events_url":"https://api.github.com/users/vim-ml/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T20:58:18Z","updated_at":"2015-08-21T20:58:18Z","body":"So we should remove the fnameescpae()?"}}