Closed v-yadli closed 10 years ago
Please copy the lines from your :mes
buffer.
You should see something like this after you do the steps above:
/Users/choi/p/ri.vim/plugin/ri_vim.rb 'print'
/Users/choi/p/ri.vim/plugin/ri_vim.rb -d 'ARGF#print'
If you see lines like this, try to execute the commands individually on the command line.
This is the interesting part. Instead of getting ri_vim -d 'ARGF#print', I get ri_vim -d 'print'.
related :mrs buffer content:
ri_vim 'print' ri_vim 'print' ri_vim -d 'print' No matches!
How did I produce these messages: Leader+r, bring up the search buffer; type 'print', then hit tab twice. Hit enter.
Try putting some echom query
debugging statements in the doSearch() function:
https://github.com/danchoi/ri.vim/blob/master/plugin/ri.vim#L234
Start at the bottom of the function and move upward with the debugging. You might see where the query string is being truncated or misread.
I think I know what happened now. In s:doSearch(), getline() is used to obtain the query line. So if the query line is 'print', it will search for 'print'.
The only problem is that auto completion is not so aggressive to replace the query string when it's not the prefix of a suggestion.
Did you type 'print' and then press TAB first before you pressed ENTER? The TAB keystroke is necessary to autocomplete the module or class prefix for the method.
yes.
If I type 'IO#pri' then tab, it will autocomplete to 'IO#print'. (So the code logic is actually working)
However, if I type 'print' then tab, the query string remains to be 'print'. I guess it's a feature not a bug? :-)
Strange that print
doesn't TAB-autocomplete. Does the same thing happen for puts
and delete
?
The same thing. I noticed that there're two columns in the autocomplete entries. And the query string is completed to the first column, while the second is the actual full name.
Can you screenshot what your autocomplete looks like? It should look something like this:
After hitting tab, it looks like this:
Note that it's different from your screenshot that the full name is not attached at the end. Just bare 'print'
If you scroll down the completion matches with CTRL-n and then press ENTER, does it work?
No. Both failed.
On 5 Mar, 2014, at 10:39 am, Daniel Choi notifications@github.com wrote:
If you scroll down the completion matches with CTRL-n and then press ENTER, does it work?
— Reply to this email directly or view it on GitHub.
Try using this new version at https://github.com/danchoi/ri.vim/blob/master/plugin/ri.vim
It may fix your problem, but I'm not sure if the fix has side effects yet.
Problem fixed. Now the full name is attached at the end. The side effect on my side is mainly about permissions. It might be due to that I directly replaced ri.vim in the gem directory (for that the plugin in .vim dir just source that one and I don't want to break this).
You might need to add
#!/usr/bin/ruby
on the first line of ri_vim.rb and then set execute permission to it. Also, my gem installation doesn't allow users to write ri_vim_cache directory. So I just chown'ed that.
Thanks for the help! :-)
I'm glad it worked. If you're interested in helping maintain this project, let me know and I'll add you as admin.
I'm not really familiar with VimL and Ruby... Actually I'm doing a little project to learn ruby. I'll fork this project and in case there's something I could help, I will send you a pull request. :-)
@v-yadli the issue you reported is not there anymore, I will close this issue.
For example, if one type 'print' in the query window, 'ARGF#print' will be provided as an autocomplete entry. However, when enter key is hit, the query string remains to be 'print' and 'no matches!' is displayed, instead of the documentation of 'ARGF#print'.