Shougo / unite.vim

:dragon: Unite and create user interfaces
http://www.vim.org/scripts/script.php?script_id=3396
Other
2.85k stars 227 forks source link

fix rename: get the exact buffer number with the old filename #1246

Closed itchyny closed 5 years ago

itchyny commented 5 years ago

This pull request fixes rename action. With current implementation the action fails to rename directory where some file in the directory is loaded.

Steps to reproduce

 $ mkdir foo
 $ touch foo/bar
 $ vim foo/bar
:VimFiler
:echo bufnr('foo') // prints 1 because bufname(1) ==# 'foo/bar'
rqux<CR> // rename foo directory, not foo/bar file

Expected behavior

The foo directory is renamed to qux.

Actual behavior

New qux file (not directory) is created and foo directory is not renamed.