Created
May 13, 2013 16:20
-
-
Save sgur/5569560 to your computer and use it in GitHub Desktop.
googlesuggest-complete-vim (https://github.com/mattn/googlesuggest-complete-vim) を &filetype で絞り込む変更
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/autoload/googlesuggest.vim b/autoload/googlesuggest.vim | |
index eb3ae37..3f652ab 100644 | |
--- a/autoload/googlesuggest.vim | |
+++ b/autoload/googlesuggest.vim | |
@@ -68,12 +68,11 @@ function! googlesuggest#Complete(findstart, base) | |
else | |
" find months matching with "a:base" | |
let ret = [] | |
- let res = webapi#http#get('http://suggestqueries.google.com/complete/search', {"client" : "youtube", "q" : a:base, "hjson" : "t", "hl" : g:googlesuggest_language, "ie" : "UTF8", "oe" : "UTF8" }) | |
+ let res = webapi#http#get('http://suggestqueries.google.com/complete/search', {"client" : "youtube", "q" : &filetype . ' ' . a:base, "hjson" : "t", "hl" : g:googlesuggest_language, "ie" : "UTF8", "oe" : "UTF8" }) | |
let arr = webapi#json#decode(res.content) | |
for m in arr[1] | |
- call add(ret, m[0]) | |
+ call add(ret, substitute(m[0], '^' . &filetype . '\s', '', 'g')) | |
endfor | |
return ret | |
endif | |
endfunction | |
- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment