Skip to content

Commit 5e510f0

Browse files
Merge pull request #49 from francoiscabrol/bugfix/34-kills-non-ranger-buffer
Fix #34 delete only the ranger buffer
2 parents 5f71be7 + 110a80a commit 5e510f0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugin/ranger.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ if has('nvim')
4242
function! OpenRangerIn(path, edit_cmd)
4343
let currentPath = expand(a:path)
4444
let rangerCallback = { 'name': 'ranger', 'edit_cmd': a:edit_cmd }
45-
function! rangerCallback.on_exit(id, code, _event)
46-
silent! Bclose!
45+
function! rangerCallback.on_exit(job_id, code, event)
46+
if a:code == 0
47+
silent! Bclose!
48+
endif
4749
try
4850
if filereadable(s:choice_file_path)
4951
exec system('sed -ie "s/ /\\\ /g" ' . s:choice_file_path)

0 commit comments

Comments
 (0)