-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add support for unite.vim about :GoDecls / :GoDeclsDir #1391
Conversation
96f99db
to
b6fa4fb
Compare
Fixed docs & pass the tests |
Thanks @delphinus I need to install unite.vim and see how it behaves and works. One question though, while quick skimming the code, I wonder what happens if |
Ah, good point. I see many unite addon have error handling from source command output. I will add it. |
autoload/unite/sources/decls.vim
Outdated
endif | ||
|
||
let l:include = get(g:, 'go_decls_includes', 'func,type') | ||
let l:command = printf('%s -format vim -mode decls -include %s -%s %s', l:bin_path, l:include, l:mode, l:path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should shellescape()
most or all the variables you're printf-ing in the command string; otherwise stuff will break if the path contains spaces or special shell characters (this is uncommon in Go, but not illegal either, and especially an issue on systems like Windows with stuff Application Data
in the path).
For example, if I use :Unite decls
on ~/go/src/a/space path/space name.go
I get [unite.vim] [decls] command returned invalid response.
.
Other than this it seems to work well 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for reviewing 👍 I fixed it.
unite.vim is a powerful "listing & selecting" plugin that looks like ctrlp.vim. I want to use
:GoDeclsDir
feature with unite.vim and have implemented it.It has almost like
:GoDeclsDir / :GoDecls
, but differs at some points below.:Unite decls
has features for both:GoDeclsDir
and:GoDecls
, but the main target is:GoDeclsDir
becauseunite.vim
has already:Unite outline
that is similar to:GoDecls
.:Unite decls
does not conflict with the existent:GoDecls / :GoDeclsDir
, so both of them can be used if both unite.vim and ctrp.vim are installed.The document about this on
vim-go.txt
is the one I am worrying about. I placed it at the next of:GoDeclsDir
, but does anyone have an idea to place somewhere better?:Unite decls
:Unite decls:appengine.go
:Unite outline