Closed sloria closed 8 years ago
Same for neovim 0.1.3.
are you using gist.vim over http proxy?
Nope, but something strange just happened. I've tried adding a new private gist just now (after restarting neovim) and it worked... It printed the link...
Could you please upgrade webapi-vim?
I already have the latest version and managed to get the error with ':Gist -p' just now.
Could you please apply following patch to debug this issue?
diff --git a/autoload/webapi/http.vim b/autoload/webapi/http.vim
index f7b9eb2..123768e 100644
--- a/autoload/webapi/http.vim
+++ b/autoload/webapi/http.vim
@@ -159,6 +159,7 @@ function! webapi#http#get(url, ...) abort
throw "require `curl` or `wget` command"
endif
if follow != 0
+ let g:debug = res
while res =~ '^HTTP/1.\d 3' || res =~ '^HTTP/1\.\d 200 Connection established' || res =~ '^HTTP/1\.\d 100 Continue'
let pos = stridx(res, "\r\n\r\n")
if pos != -1
Gist -p
:echo debug
Note that please don't paste secret contents on here.
E121: Undefined variable: debug
E15: Invalid expression: debug
Using latest neovim with vim-plug on OS X.
Maybe fixed. Could you please try latest webapi-vim.
Installed the update. Same issue.
try to put let g:debug = res
on https://github.com/mattn/webapi-vim/blob/master/autoload/webapi/http.vim#L243
Here's an example Gist I made from vim: https://gist.github.com/eiginn/66abf9416e91bf0e8750ebee13f518f4 debug contents: https://gist.github.com/eiginn/82409aacb4fe3f62e5431d76f4182845
Today, I updated webapi-vim. could you please try latest?
could be related to vim-plug, i nuked and re cloned the repo in the right place and its working. previously git log only showed last commit about curl workaround and nothing else
Updated. Worked for the first paste. Then I tried to paste again with Gist -p and it failed with:
Updating gist...
Post failed: Not Found
I just run :Gist -p
twice.
https://gist.github.com/mattn/e25be0af84ee34d14a5ad090cffae5fc
https://gist.github.com/mattn/e25be0af84ee34d14a5ad090cffae5fc/revisions
But no errors.
Same error here with vim.
@enkeyz do you use latest gist-vim and webapi-vim?
@mattn I did PlugUpdate before testing.
@mkozjak could you please try https://github.com/mattn/gist-vim/issues/205#issuecomment-214230465 ?
@mattn Yes, I'm using latest of everything.
+1 on this issue as well. NeoVim 0.1.4 using vim-plug.
+1, using neovim 0.1.5
The gist gets posted even with the error. However if i select just a small amount of lines and run :'<,'>Gist
there is no error and the plugin behaves as expected.
I don't reproduce this after I fixed webapi-vim in few days ago.
Seeing the same thing with NeoVim 0.1.4 using vim-plug (all versions latest). Seems to only occur when posting to Gist, but does happen on both create and updating.
This is my gist that I did :Gist
and :w
after opening gist from :Gist -l
.
https://gist.github.com/mattn/a0158a1b46da3a52cb576a6ff99ebffd/revisions
AFAICS, no problem.
It works fine if I only save a very small gist (e.g. by visual selecting a line and :'<,'>Gist
, as per @JLoureir0's comment), so your example works fine @mattn. The error seems to appear when you save larger gists - in my case it failed when I tried to save over 20 lines.
@tombeynon +1
This is a gist I just post https://gist.github.com/mattn/318aa07ee9cee4c47984cdb7c27c6d69/revisions
6498 lines.
And this is one that :<,>Gist
of mbyte.c
https://gist.github.com/mattn/dadb18fc63ff457acc89b37878d23553
With Vim 7.4.1707 the behavior is exactly the same as NeoVim, it post to Github but it gives out the error unless the amount of data on the gist is really small.
My version of curl is 7.48.0
I can reproduce in Vim 7.3 using this minimal vimrc, and this content.
vim -u test-vimrc
// create test file, didn't save
:Gist
As mentioned it does actually save (that gist I linked to is the result of getting that error), and doesn't seem to happen with smaller files.
@mattn:
try to put
let g:debug = res
on https://github.com/mattn/webapi-vim/blob/master/autoload/webapi/http.vim#L243
Here is the :echo debug
result: https://gist.github.com/JLoureir0/f626c723a61d12b687772519fe3f0864#file-t-txt
Maybe this part doesn't work expected.
https://github.com/mattn/webapi-vim/blob/master/autoload/webapi/http.vim#L243
Strange. Then your gist-vim or webapi-vim should work well.
Many thanks to responses for this.
I figure out that some version of curl return response that contains strange \r.
Thanks for the getting to the bottom of it @mattn - working great now.
Working good, thanks!
Thanks for the fix @mattn. Working great again.
Still getting (:Gist
):
Posting it to gist...
Post failed: Not Found
Press ENTER or type command to continue
No operations are working except for when I set:
let g:gist_post_anonymous = 1
Note that :Gist -l
is working so it is not an issue with my user.
MacVim
Both plugins updated just now
Using token in ~/.gist-vim
@mblarsen did you try with latest gist-vim and webapi-vim ?
@mattn I ran an update with vundle's :PluginUpdate should I update manually to get the latest? Note that I can read gists but I cannot post unless anonymous.
@mattn Just tried checking out both repos. It made no difference. I can post as anonymous only, but I can connect to github and get my gists. I cannot save them after making changes.
@mattn my apologies, it turns out that my two-factor token didn't have gist access.
:)
On Vim 7.4.1707 with the latest gist-vim (as of this writing), I am getting an error every time I run
:Gist
that readsConsequently,
let g:gist_open_browser_after_post = 1
does not work.However, the Gists actually get posted successfully.
Any ideas?