lambdalisue / vim-gista

An alternative gist.vim, vim plugin which manipulate gists in Vim.
http://www.vim.org/scripts/script.php?script_id=4976
MIT License
156 stars 5 forks source link

Neovim Error? #74

Closed vito-c closed 8 years ago

vito-c commented 8 years ago

I'm getting this error when trying to run Gista list

I can use Gista post just fine though so I'm not sure what the error is :(

Loading a gist index of vito-c in GitHub from a local cache ...
Error detected while processing function gista#command#command..gista#command#list#command..gista#command#list#open..gista#command#list#call..gista#resource#remote#list..153..<SNR>188__retrieve_python..provider#python#Call:
line   18:
UnboundLocalError("local variable 'namespace' referenced before assignment",)
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/neovim/msgpack_rpc/session.py", line 177, in handler
    rv = self._request_cb(name, args)
  File "/Library/Python/2.7/site-packages/neovim/api/common.py", line 237, in filter_request_cb
    walk(self._in, args, self, name, 'request'))
  File "/Library/Python/2.7/site-packages/neovim/plugin/host.py", line 65, in _on_request
    rv = handler(*args)
  File "/usr/local/Cellar/neovim/HEAD/share/nvim/runtime/autoload/provider/script_host.py", line 85, in python_execute_file
    exec(script, self.module.__dict__)
  File "/Users/vito-c/.nvim/bundle/vim-gista/autoload/vital/__latest__/Web/API/github.py", line 189, in <module>
    _vim_vital_web_api_github_main()
UnboundLocalError: local variable 'namespace' referenced before assignment
lambdalisue commented 8 years ago

Currently neovim is not supported. I know how to fix but i would like to focus vim-gita for several weeks so please wait :-]

lambdalisue commented 8 years ago

Try https://github.com/lambdalisue/vim-gista/tree/develop branch

ahmedelgabri commented 8 years ago

Any plans/updates on neovim support?

lambdalisue commented 8 years ago

I'm sorry for late but it should be fixed from https://github.com/lambdalisue/vim-gista/commit/c6e0f5e54c85a1d124e3fab0f5e78fd1d37878d0 Please close the issue if you confirm @vito-c

vito-c commented 8 years ago
Error detected while processing function gista#command#command[26]..gista#command#list#command[15]..gista#command#list#open[5]..gista#command#list#call[7]..gista#resource#remote#list[43]..15
3[33]..<SNR>167__retrieve_python[23]..<SNR>167__throw:
line    2:
E605: Exception not caught: vital: Web.API.GitHub: TypeError: Cannot mix str and non-str arguments at /Users/vitocutten/GDrive/pirate-vim/bundle/vim-gista/autoload/vital/__vim_gista__/Web/AP
I/github.py:187
vito-c commented 8 years ago

@lambdalisue still doesn't seem to be fixed

lambdalisue commented 8 years ago

Hum... Which step did you get that error?

vito-c commented 8 years ago

:Gista list

lambdalisue commented 8 years ago

Hum.... It worked on my Mac. I'll check it again. Btw which version of Neovim and Python do you use?

vito-c commented 8 years ago
nv --version
NVIM 0.1.4
Build type: RelWithDebInfo
Compilation: /usr/local/Library/ENV/4.3/clang -Wconversion
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wall -Wextra -pedantic
-Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla
-fstack-protector-strong -fdiagnostics-color=auto
-DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H
-I/tmp/neovim-20160508-41603-805yt6/neovim-0.1.4/build/config
-I/tmp/neovim-20160508-41603-805yt6/neovim-0.1.4/src
-I/tmp/neovim-20160508-41603-805yt6/neovim-0.1.4/deps-build/usr/include
-I/tmp/neovim-20160508-41603-805yt6/neovim-0.1.4/deps-build/usr/include
-I/tmp/neovim-20160508-41603-805yt6/neovim-0.1.4/deps-build/usr/include/luajit-2.0
-I/tmp/neovim-20160508-41603-805yt6/neovim-0.1.4/deps-build/usr/include
-I/tmp/neovim-20160508-41603-805yt6/neovim-0.1.4/deps-build/usr/include
-I/tmp/neovim-20160508-41603-805yt6/neovim-0.1.4/deps-build/usr/include
-I/tmp/neovim-20160508-41603-805yt6/neovim-0.1.4/deps-build/usr/include
-I/usr/local/opt/gettext/include -I/usr/include -I/usr/include
-I/tmp/neovim-20160508-41603-805yt6/neovim-0.1.4/build/src/nvim/auto
-I/tmp/neovim-20160508-41603-805yt6/neovim-0.1.4/build/include

Optional features included (+) or not (-): +acl   +iconv    +jemalloc
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.1.4/share/nvim"
python3 --version
Python 3.5.1
lambdalisue commented 8 years ago

Got. Prob. because of Python 3 while I just tested with Python 2. I'll fix

lambdalisue commented 8 years ago

I'm sorry but I could not reproduce the issue with the following.

NVIM v0.1.5-752-gfb98145
Build type: Release
Compilation: /usr/bin/cc -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/home/alisue/Code/github.com/neovim/neovim/build/config -I/home/alisue/Code/github.com/neovim/neovim/src -I/home/alisue/Code/github.com/neovim/neovim/.deps/usr/include -I/home/alisue/Code/github.com/neovim/neovim/.deps/usr/include -I/home/alisue/Code/github.com/neovim/neovim/.deps/usr/include -I/home/alisue/Code/github.com/neovim/neovim/.deps/usr/include -I/home/alisue/Code/github.com/neovim/neovim/.deps/usr/include -I/home/alisue/Code/github.com/neovim/neovim/.deps/usr/include -I/usr/include -I/home/alisue/Code/github.com/neovim/neovim/build/src/nvim/auto -I/home/alisue/Code/github.com/neovim/neovim/build/include
Compiled by alisue@alisue-desktop-lab

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui      
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/share/nvim"

What the value of has('python') and has('python3')

zexi commented 8 years ago
Error detected while processing function gista#command#command[26]..gista#command#list#comm
and[15]..gista#command#list#open[5]..gista#command#list#call[7]..gista#resource#remote#list
[43]..247[33]..<SNR>139__retrieve_python[23]..<SNR>139__throw:
line    2:
E605: Exception not caught: vital: Web.API.GitHub: TypeError: Cannot mix str and non-str ar
guments at /Users/lzx/.vim/plugged/vim-gista/autoload/vital/__vim_gista__/Web/API/github.py
:187

I use Python 2.7.12 and (nvim or macvim) get the problem too.

Add below code to covert kwargs dict's key&value to unicode seems work. @vito-c @lambdalisue

diff

lambdalisue commented 8 years ago

Which version of Neovim did you use? I could't reproduce the error on my environment...

Based on your comment, I tried to fix the problem so could you try the below? https://github.com/lambdalisue/vim-gista/tree/neovim-fix-trial

zexi commented 8 years ago
$ nvim -v
NVIM 0.1.5
Build type: RelWithDebInfo
Compilation: /usr/local/Library/ENV/4.3/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -I/tmp/neovim20160829-10141-1bpa70y/neovim-0.1.5/build/config -I/tmp/neovim20160829-10141-1bpa70y/neovim-0.1.5/src -I/tmp/neovim20160829-10141-1bpa70y/neovim-0.1.5/deps-build/usr/include -I/tmp/neovim20160829-10141-1bpa70y/neovim-0.1.5/deps-build/usr/include -I/tmp/neovim20160829-10141-1bpa70y/neovim-0.1.5/deps-build/usr/include -I/tmp/neovim20160829-10141-1bpa70y/neovim-0.1.5/deps-build/usr/include -I/tmp/neovim20160829-10141-1bpa70y/neovim-0.1.5/deps-build/usr/include -I/tmp/neovim20160829-10141-1bpa70y/neovim-0.1.5/deps-build/usr/include -I/usr/local/opt/gettext/include -I/usr/include -I/usr/include -I/tmp/neovim20160829-10141-1bpa70y/neovim-0.1.5/build/src/nvim/auto -I/tmp/neovim20160829-10141-1bpa70y/neovim-0.1.5/build/include
Compiled by lzx@zexilideMacBook-Pro.local

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.1.5/share/nvim"

https://github.com/lambdalisue/vim-gista/tree/neovim-fix-trial fix the problem, thx! ;) 👍

lambdalisue commented 8 years ago

@vito-c @ahmedelgabri @Zexi Should be fixed in 2.4.0. Try the latest in master branch :smile: