mattn / livestyle-vim

Emmet LiveStyle for Vim
http://mattn.kaoriya.net/
108 stars 5 forks source link

vim crashes #4

Closed accid0 closed 9 years ago

accid0 commented 11 years ago

Vim crashes after :LiveStyle command on win 32

mattn commented 11 years ago

I don't reproduce it. What version of vim do you use? 7.3.XXX ?

accid0 commented 11 years ago

7.3.762 but vim only terminated

mattn commented 11 years ago

Could you explain more detail?

lenny0702 commented 11 years ago

hi, really exicited about the vim support for livestyle.Thanks for your great work But I am facing the similar problem when I try to set up. Problem:"Vim crashes after :LiveStyle command on win 32" version :7.3.46 crash every time no exception,no error info, just can't do anything in vim,no response. PS. If I open gvim and type :LiveStyle command first,then it's fine, I can input something,create a file. But after that I type ":e test.css", no response again. Expecting your answer ,thanks!

Maybe this images will help, this is my situation after type ":livestyle " ,seems got some error. vim

If there is something I can do to help you to fix this, feel free to contact me, this plugin is really helpful!

accid0 commented 11 years ago

https://github.com/mattn/livestyle-vim/issues/4#issuecomment-22534932

gvim 7.3.762 every time when i'm used :Livestyle or :call livestyle#setup() - vim off without any system message autoload / livestyle.vim 38 line - error??? and i'm comment 11-18 lines and replace it let s:use_python = 0 and i get a error Error detected while processing function livestyle#setup..49_do_post: line 6: E117: Unknown function: webapi#json#encode E116: Invalid arguments for function webapi#http#post E117: Unknown function: webapi#json#encode E116: Invalid arguments for function webapi#http#post and livestyled.exe are opened in terminal window

mattn commented 11 years ago

Try to install github.com/mattn/webapi-vim with keep the comment-out.

On 8/14/13, Andrew Scherbakov notifications@github.com wrote:

https://github.com/mattn/livestyle-vim/issues/4#issuecomment-22534932

gvim 7.3.762 every time when i'm used :Livestyle or :call livestyle#setup() - vim off without any system message autoload / livestyle.vim 38 line - error??? and i'm comment 11-18 lines and replace it let s:use_python = 0 and i get a error Error detected while processing function livestyle#setup..49_do_post: line 6: E117: Unknown function: webapi#json#encode E116: Invalid arguments for function webapi#http#post E117: Unknown function: webapi#json#encode E116: Invalid arguments for function webapi#http#post and livestyled.exe are opened in terminal window


Reply to this email directly or view it on GitHub: https://github.com/mattn/livestyle-vim/issues/4#issuecomment-22571276

accid0 commented 11 years ago

i tried it and get in livestyled window

2013/08/13 20:51:07 {"data":{"id":"Vim7.3","files":["path/to/my/style.css"],"icon":"data:image/png;base64,iVBOR w0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAEnQAAB J0BfDRroQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAMXSURBVDiNdZNbbFRVF Ia/fTjTuRxnOi2EtJBo2kiiRiyEllEkamiqGAGjSTWRTMAoSELfIF4wrQJJVSyIQHzwQpCpOhSsGB80b XhAjcYATQuEsSUGaoFBalN75szM6czZe/tgOwWj+3X969//WvmW0FrzX08IYcSenrNdKl08fXxsp/4fo YivW1v55JqnToQj4Wo0AgCt9fGepLqj+bcqlNDXeuf3PfHA+iqgDCBjZwqfJT/f1n30y4RZU1Mbf7Spa ZGU6hbnyWKBrjPriNbkxcrlh+tjS2JMhzBNk9N9ZzqAhJFKXTj0xZHkmFIKz/PwPI+Rkd9JHPuQinkmZ WaIk5c+4vof6VJ9aGiQk9//OARgdCWPTZw7N7Dedd2SIJVKMW/VWayID58IsnD2KiqilXiex+Xhy7z82 rYLeSezGsAAUFIJpWTJQGmNzwzgM0Lc42yl6f5mCoUCV66M0L63leq64qX+/v4JAEMIYejoeKuUMyOgF aYIUDu+icaGZlx3knQ6zc69r7IwfpWHnq1+/MXWld1CCGEsWBrZeO+yufVKq1sSLJiMs2JJM/l8ntHRU drff5365zPcVh7gL++iseKZu9bcWR9Za05m9VmZC7hKqqDneQDU3beIUGgZuVwO27Z5e18bsRdcguHgF CMG0rYcN6POG8Pn7Z9+/nbwoJQzOwgEAuRyOSbsCd7Z9wYPblCUV4QoM4P4fRZVstH+9L1vWkZ+zfQbA OWB6u/0TSM4joPjOOzav4OHXzKJVlqUzQriNy3mFh6xP+7obuk9OpAAMKfIY3qJQgiKXpGOA+00brIIV 5ql2JFsg/1BR2dLT1dfYho4E0CjUUohpURrxZ4Du/VjmytEZPZMs5VZ7Ox/6/Ar6WEjeTOx/3CglBRCI KVH25vbr98Yv/bJ7f7leb9p4fdZhO2l7u62zoPpYT0I3F3XEJtf1xDzlxJks9lTPSd6//yq++vRMdvea s4yvT07OvXmLc/FpVLq3V2HkmM35A+AmPpUAApA/PtKp5wtwHLd8VolhQxZ0atAFsgB+YFTv8hp/d+3K JyTs2tiKQAAAABJRU5ErkJggg==","title":"Vim7.3"},"action":"id"}

Editor hangs and does not respond even after closing livestyled.exe in chrome F12->LiveStyle i'm get undefined in editor place

mattn commented 11 years ago

Then, at once, restart chrome. and vim. And type F12, and check Vim icon is displayed.

accid0 commented 11 years ago

i tried it but vim always hangs and high uses load cpu, in chrome gets undefined editor icon

mattn commented 11 years ago

Do you have curl.exe ? If you have, try to do:

C:\> curl http://localhost:54000/
accid0 commented 11 years ago

after :LiveStyle i gets 'OK'

lenny0702 commented 11 years ago

my problem is same, curl return ok , and in chrome gets undefined

mattn commented 11 years ago

Try this:

  1. Start livestyled.exe on cmd.exe
  2. Start google chrome
  3. Start gvim
  4. :LiveStyle!
accid0 commented 11 years ago

nothing new

mattn commented 11 years ago
  1. Start livestyled.exe on cmd.exe
  2. Start google chrome, open developer tools with F12, open LiveStyle tab.
  3. CTRL-C to livestyled.exe

Probably, you can see the icon will be changed.

lenny0702 commented 11 years ago

yes,changed to this qq20130814173819

but vim still hangs

mattn commented 11 years ago

Ok, It's my expected.

Then, :LiveStyle, and click reload button.

accid0 commented 11 years ago

https://github.com/mattn/livestyle-vim/issues/4#issuecomment-22620956 gets it No active editor after then i tried :LiveStyle! but vim hangs and editor icon again undefined

accid0 commented 11 years ago

p.s. vim still hangs if close the livestyled with C^C

mattn commented 11 years ago

Hmm, do you have HTTP_PROXY environment variable?

mattn commented 11 years ago

Do you get result from webapi?

:echo webapi#http#post("http://localhost:54000/vim", {"foo":"bar"})

BTW, what mean do you use for hang, no operatable?

lenny0702 commented 11 years ago

qq20130814183805 I deleted HTTP_PROXY environment variable and "hang" means no response, no peratable, after ":e test.css" command , the text even not appear

mattn commented 11 years ago

Ah, did you set HTTP_PROXY and deleted it? Maybe it will work correctly. Or you can set NO_PROXY environment variable. :)

accid0 commented 11 years ago

:echo webapi#http#post("http://localhost:54000/vim", {"foo":"bar"}) I get the same thing in vim https://github.com/mattn/livestyle-vim/issues/4#issuecomment-22627151 and in livestyled 2013/08/14 14:05:08 invalid character 'o' in literal false (expecting 'a') HTTP_PROXY and NO_PROXY are not set

mattn commented 11 years ago

I get the same thing in vim #4

I know. It's not important thing. If you removed HTTP_PROXY, you'll see :LiveStyle is working good maybe.

accid0 commented 11 years ago

i tried :echo HTTP_PROXY and gets E121: Undefined variable .... and I did not delete HTTP_PROXY

mattn commented 11 years ago

Yes, did you try :LiveStyle after deleted HTTP_PROXY?

accid0 commented 11 years ago

it just is missing variable in environment

mattn commented 11 years ago

I wonder whether you did :LiveStyle after you deleted HTTP_PROXY environemnt variable.

accid0 commented 11 years ago

Yes, i tried it and nothing new. Vim hangs and not responded.

mattn commented 11 years ago

Please teach me your status.

You could get something response from livestyled.exe with curl. So your vim should get response immediately. I doubt your vim's version is wrong. First post via :LiveStyle command is doing simple handling. :-(

https://github.com/mattn/livestyle-vim/blob/master/livestyled/livestyled.go#L26

accid0 commented 11 years ago

1)yes 2)yes 3)yes !!!vim hangs and not responded only for .css files

accid0 commented 11 years ago

for exeperimental i comment autoload/livestyle.vim lines 182-191 augroup LiveStyle autocmd! autocmd CursorHold * silent! call livestyle#update() autocmd CursorHoldI * silent! call livestyle#update() autocmd CursorMoved * silent! call livestyle#update() autocmd CursorMovedI * silent! call livestyle#update() autocmd InsertLeave * silent! call livestyle#update() autocmd BufEnter * silent! call livestyle#updateFiles() autocmd VimLeavePre * silent! call livestyle#shutdown() augroup END

and vim nice work after :LiveStyle and after this exp. i uncomment it and vim again not responded after :LiveStyle command

mattn commented 11 years ago

Are you install another plugin that using updatetime variable? For example neocompletecache.

mattn commented 11 years ago

Try with comment-out following part.

set updatetime=100
mattn commented 11 years ago

@reHePaJI Try latest update. cecfb8ba4f5f260f8e78d9fafa4e91840e88caef

accid0 commented 11 years ago

Ok, i merge it and vim already hangs at once, cursor blinks until you do something :)

mattn commented 11 years ago

In latest updates, I added some tune-ups. Are you getting this problem still now? What spec of your machine?

accid0 commented 11 years ago

problem is still there my machine intell celeron 420@1.6 GHz 2GB

mattn commented 11 years ago

Sorry, I can't understand what trigger of hang. Typing keys? Inserting characters?

mattn commented 11 years ago

Maybe webapi will make your vim slow because it's a pure vim script. If you can use if_python, it make faster.

mattn commented 11 years ago

One more question, the hang make CPU 100%?

accid0 commented 11 years ago

1) vim in normal mode and cursor blink 2) i call :LiveStyle and wait while livestyled loaded 3) after it cursor still blink, but if i move it or type a for inserting only then vim hangs 4) gvim uses 100% cpu

mattn commented 11 years ago

I want to figure out this issue caused which livestyled.exe or livestyle.vim

:echo webapi#http#post("http://localhost:54000", webapi#json#encode({"name": "vim", "path": "foo"}))

What result do you get?

accid0 commented 11 years ago

image and in livestyled.exe terminal window 2013/08/14 20:53:56 {"name":"vim","path":"foo"}

mattn commented 11 years ago

Ok, then it seems the issue is communication between livestyled.exe and chrome.

mattn commented 11 years ago

Another possibility. You CSS is big? If you are ok, please show me the css?

accid0 commented 11 years ago

https://dl.dropboxusercontent.com/u/76070617/style.css

mattn commented 11 years ago

Open css file.

:call livestyle#lang#css#parse("")

Hang? Or

:call livestyle#update()

Hang?

accid0 commented 11 years ago

1):call livestyle#lang#css#parse("") - vim hangs 2):call livestyle#update() = vim hangs