-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When opening a new file using neovim-fuzzy the cwd for the "current" tab is changed to the git root #46
Comments
BTW tested this with |
Here is my workaround: fun s:FuzzyOpener(val)
let prev_tabpage = tabpagenr()
exe "tabe" a:val
let next_tabpage = tabpagenr()
exe "tabnext" prev_tabpage
lcd -
let dir = getcwd()
exe "tabnext" next_tabpage
exe "lcd" dir
" neovim-fuzzy will execute "lcd -" so ensure the previous directory is the
" one we want
lcd /tmp
endfun
command! -nargs=1 FuzzyOpener call s:FuzzyOpener(<q-args>)
let g:fuzzy_opencmd = 'FuzzyOpener' It is dirty but it works. |
The correct fix would be to change this bit of code: neovim-fuzzy/plugin/neovim-fuzzy.vim Line 221 in 5338339
It would have to store the current tab before running the open command, and then check if the tab has changed. When it has, then it should switch to the previous tab and run |
Or alternatively it could just not |
This happens when
fuzzy_opencmd
is set totabe
(ortab drop
or any other command that opens the result in a new tab).e.g. say I am in a project called
project
inside subdirectorysubdir
which contains two files,file1
andfile2
.When I open the first file with neovim-fuzzy, say
file1
then thefile1
tab corrrectly hasproject/subdir
as itscwd
. Now if I open a second file while the file1 tab is focussed, sayfile2
then the new tab withfile2
in it has the correctcwd
ofproject/subdir
but thefile1
tab now has acwd
ofproject
.Then if I were to open a third file with
neovim-fuzzy
, while looking at thefile2
tab, now that tab will also have acwd
of the project root. It always sets thecwd
of the "current" tab to the project root.The text was updated successfully, but these errors were encountered: