ternjs / tern_for_vim

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

Autocompletion renderd buffer unusable (Stratch) #20

Open lfilho opened 11 years ago

lfilho commented 11 years ago

I was testing the plugin out the commands were running ok, and I tried the auto completion with the following code:

   it('...', function(){
       var m = new Foobar({ ... });

       expect(m.userId).toEqual('6815841748');
   });

then after the var = m bit I hit o (new line + insert mode) and type m.. It completed to m.userId automatically but the the buffer was converted into a [Scratch] - PRV and I couldn't edit it anymore - kept me giving the E523: Not allowed here.

And in the terminal (I had opened MacVim from there) there was this: Exception TypeError: "'NoneType' object is not callable" in <bound method Project.__del__ of <__main__.Project object at 0x110d22150>> ignored

Using MacVim. With neocomplcache plugin (maybe a conflict?)

marijnh commented 11 years ago

Doesn't happen for me -- but I'm on Linux, and I don't have neocomplcache. Try disabling that. Does this happen consistently when you follow these steps?

@clausreinke This might be related to the preview window functionality. Any ideas?

clausreinke commented 11 years ago

Doesn't happen here, either. Agree, try disabling neocomplcache plugin first, to reduce the number of moving parts.

(which reminds me, tern doesn't support Vim standard for disabling plugins: :help write-filetype-plugin)

snj33v commented 11 years ago

:8ball: neocomplcache does conflict with tern plugin

marijnh commented 11 years ago

Too bad. Did you see why they conflict, and how we might work around that?

@clausreinke As for disabling plugins -- is pasting in the (somewhat silly) code at the top of that help topic the solution you'd recommend?

clausreinke commented 11 years ago

@marijnh I don't usually disable plugins that way, just noticed that it might come in handy for things like conflict checking/avoidance. And no, it isn't quite as simple: tern is currently configured as an add-on to the javascript filetype plugin, so it cannot use b:did_ftplugin (which is set by the default javascript plugin). One could use a tern-specific flag to disable tern loading, similar to the recommendation for general plugins (:help write-plugin|/LOADING). Not sure whether it is worth it, though.

As for neocomplcache, it seems to be one of those completion-multiplexer/extender things, offering different kinds of completion under the same keybinding, so it might not even be a conflict, more a case of needing an adapter. But that is just a guess.

Shougo commented 11 years ago

Hi, I'm author of neocomplcache. I will try this issue later.

Shougo commented 11 years ago

I tested your code in neocomplcache and neocomplete. But it worked("m.userID" is completed).

screenshot

So, I think it is not neocomplcache problem.

Note: I don't set tern.vim's configuration.