ternjs / tern_for_vim

Tern plugin for Vim
MIT License
1.83k stars 100 forks source link

'NoneType' object is not iterable again! #46

Closed manicmaniac closed 5 years ago

manicmaniac commented 11 years ago

I use tern and this plugin on my Ubuntu Linux.

When I have edited a new unnamed buffer and started completion, I saw the error below:

Error occured calling omnifunction: tern#Complete Vim(python):Traceback (most recent call last): Traceback (most recent call last): File "", line 1, in File "", line 226, in tern_ensureCompletionCached File "", line 164, in tern_runCommand File "", line 122, in tern_fullBuffer File "", line 111, in tern_relativeFile TypeError: 'NoneType' object has no attribute 'getitem'

This error won't occur if editing a file once saved. In the function tern_relativeFile(), python calls vim function 'expand'. But this function does not work if you editing unnamed buffer.

Somehow this bug will not be occur in another environment(OSX), though I installed the same .vimrc and plugins in all my PCs.

marijnh commented 10 years ago

Sorry about the extremely slow response. I'm on Linux and have never managed to reproduce this error. If you get the current tern_for_vim code from the repository, does the problem still occur?