Skip to content
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

search directory is wrong, and seems that it's not working either #2

Closed
jojoyuji opened this issue Feb 26, 2014 · 15 comments
Closed

search directory is wrong, and seems that it's not working either #2

jojoyuji opened this issue Feb 26, 2014 · 15 comments
Labels

Comments

@jojoyuji
Copy link

I've maintaining my macvim via homebrew, so when I trigger leaderF the current search directory is: /usr/local/Cellar/macvim/7.4-72/MaVim.app/Contents/Resources/vim/runtime/

but still, I don't think it's working either

PS: I'm currently calling :Leaderf.
The MRU and Buffer are ok 👍

@Yggdroot
Copy link
Owner

I'm sorry, I don't understand what you mean, could you state the issue in more detail?

@notzhan
Copy link

notzhan commented Mar 10, 2014

我也有这样的问题, 我在 ~/tmp/testdir 中打开目录中的 a.c, 然后使用 ,f 或者 :leaderf, 插件并没有在当前的 /tmp/testdir 中检索文件而是在 /usr/share/vim/vim73 下检索文件, 无法检索到当前目录的 b.c 和 c.c , 得到的结果是这样的:
scrot

@Yggdroot
Copy link
Owner

You can use :pwd to see what the current working directory is before launching LeaderF. If it's /usr/share/vim/vim73/, I think this issue is not related to LeaderF.

@notzhan
Copy link

notzhan commented Mar 10, 2014

:pwd 结果 /home/imtxc/tmp/testdir

@Yggdroot
Copy link
Owner

是在vim中使用:pwd, 不是shell中,是这样吗?

@notzhan
Copy link

notzhan commented Mar 10, 2014

SURE

@Yggdroot
Copy link
Owner

由于在我的所有linux环境上都不会出现这个情况,我没法fix,could you do me a favor? thanks.

@Yggdroot
Copy link
Owner

I think I have found the root cause. You must have 'set autochdir' in your vimrc. Maybe I should let it work well no matter whether autochdir is set or not.

@notzhan
Copy link

notzhan commented Mar 10, 2014

我的 vimrc 里面已经配置了 autochdir 的

Yggdroot added a commit that referenced this issue Mar 10, 2014
@Yggdroot Yggdroot added the bug label Mar 10, 2014
@Yggdroot
Copy link
Owner

@imtxc 就是因为设了·autochdir·才有这个问题的。

@cherrot
Copy link

cherrot commented Mar 27, 2014

As default, :LeaderF would indices files of the current working directory. If I have set autochdir in my .vimrc, then this plugin is useless to me :(

I try to modify this plugin's mapping:

exec 'nnoremap <silent>' g:Lf_ShortcutF ':<C-U>Leaderf '.$PWD.'<CR>'

The reason I use $PWD instead of getcwd() is $PWD is my terminal's working directory but getcwd returns the current working directory of vim.

After the modification, I found leaderF could find my source files, but I couldn't open any of it because (I guess) leaderF uses relative path instead of absolute path even if I have provided an absolute path to :Leaderf

I know if I remove set autochdir from my .vimrc would fix this problem, but this solution brings me
inconvenience :(

I suggest reopening this bug :)

@Yggdroot
Copy link
Owner

This issue has already been fixed by c3b17d0, are you using the latest version?

@Yggdroot Yggdroot reopened this Mar 28, 2014
@cherrot
Copy link

cherrot commented Mar 31, 2014

I have update to the latest leaderF, unfortunately it doesn't help.
I think it necessary to explain what I want:

Assuming TRUNK is the root directory of my project, usually I would open a source file under this root dir of my project, assuming the file is TRUNK/src/source.py. Considering I have set autochdir in my configuration, after I have opened source.py, the current working directory (the same as getcwd() returned) would be set to TRUNK/src
Then I want to search a file, config.py, which located in TRUNK/config.
So I called LeaderF, but it only indexed files under TRUNK/src.
Then I called LeaderF $PWD or LeaderF ../. It could list all the files. However, I opened one of these files only to find it empty (new file).

In my opinion this issue could be summarized as :
Once set autochdir , LeaderF couldn't work if an directory parameter was supplied to the LeaderF command.

@Yggdroot
Copy link
Owner

I got your point, it's really a bug. I'll fix it soon. Thanks.

@Yggdroot Yggdroot reopened this Mar 31, 2014
Yggdroot added a commit that referenced this issue Apr 1, 2014
LeaderF couldn't work if an directory parameter was supplied to the
LeaderF command.
@cherrot
Copy link

cherrot commented Apr 2, 2014

It works like magic! Thanks ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants