jaxbot / browserlink.vim

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

Saving a js-file throws an error when brolink is not running. #2

Closed ghost closed 10 years ago

ghost commented 11 years ago

Steps to reproduce:

  1. Open a file vim test.js
  2. Save it :w

What I get:

Error detected while processing function <SNR>22_ReloadPage:                                                     
line    1:                                                                                                       
Traceback (most recent call last):                                                                               
  File "<string>", line 1, in <module>                                                                           
  File "/home/username/.vim/bundle/brolink.vim/plugin/websocket_client-0.11.0-py2.7.egg/websocket.py", line 741
, in send                                                                                                        
AttributeError: 'NoneType' object has no attribute 'send'

This also happens with .html and .css. I don't always need/want to run brolink when making an edit to those files, so a check would be nice.

jaxbot commented 11 years ago

For a workaround, you can set brolink to not auto update, and then add the autocmds whenever you are using Brolink. In the meantime, I'll get that smoothed out. Surprised I didn't realize that, sorry!

jaxbot commented 11 years ago

Added new option

let g:bl_no_implystart = 1

Which then allows using :BLStart to start/setup Brolink

ghost commented 11 years ago

Nice, thanks!

markwu commented 11 years ago

let g:bl_no_implystart = 1 works well. The only one problem is, it still shows error messages when I quit the Vim if I never issue BLStart command.

The error messages as follow:

處理 function <SNR>91_Disconnect 時發生錯誤: 
行    1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 33, in disconnect
  File "/home/markwu/.dot_vim/bundle/brolink.vim/plugin/websocket_client-0.11.0-py2.7.egg/websocket.py", line 749, in close