jaxbot / browserlink.vim

Live browser editing for Vim
MIT License
711 stars 38 forks source link

No live updates due to Python error #13

Closed muellermartin closed 10 years ago

muellermartin commented 10 years ago

I've just installed Brolink via Vundle and everything seemed to run fine, but after starting the node.js server via node ~/.vim/bundle/brolink.vibrolink/brolink.js and including its JavaScript (http://127.0.0.1:9001/socket.js) into the header of any HTML file, my changes do not show up like in the example.

The server log in the console confirms the connection by printing:

Requested: /socket.js
Connection accepted.

I tried to force a page reload with the BLReloadPage command and this gave me following error:

Error detected while processing function <SNR>47_ReloadPage:
line    1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'ws' is not defined

I'm using MacVim Snapshot 72 (based on VIM 7.4) on Mac OS 10.9.1 (Mavericks).

muellermartin commented 10 years ago

Never mind, I just found out that I need to run BLStart in VIM to make it work!

I'm leaving this for reference as I did not expect to find this information as a note in the "Options" section of the README:

By default as of 2.1, Brolink will not try to connect to a socket until BLStart is called.

On a side note: It would be nice if there would be a complementary command to BLStart (like BLStop) to "destroy" the handlers when saving files, because otherwise I get further Python errors when I stop the server before calling BLDisconnect (which is kind of an undocumented feature).

jaxbot commented 10 years ago

Glad you figured it out! I'm making a separate issue for your side note, too, because I think that's a valid point. Feel free to reopen if you run into anything!