jaxbot / browserlink.vim

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

need back user current path when start browserlink #35

Closed sanwv closed 9 years ago

sanwv commented 9 years ago
execute 'cd' fnameescape(s:path . "/browserlink")
call system("node browserlink.js &")

after start the service need back previous directory

sanwv commented 9 years ago

add

execute 'cd -'
jaxbot commented 9 years ago

Where are you getting those lines from? For me, it's

function! browserlink#startBrowserlink()
    if has("win32")
        call system("cd " . s:path . "/../browserlink && ./start.bat")
    else
        echo system("cd " . s:path . "/../browserlink && node browserlink.js &")
    endif
endfunction

Which will spawn a new shell and change the directory for that shell. When I execute :echo system('cd /some/other/dir'), it doesn't change the path I was previously working in.

sanwv commented 9 years ago

browserlink.vim/autoload/browserlink.vim#L37


function! browserlink#startBrowserlink()
    if has("win32")
        execute 'cd' fnameescape(s:path . "/browserlink")
        call system("./start.bat")
    else
        execute 'cd' fnameescape(s:path . "/browserlink")
        call system("node browserlink.js &")
    endif
endfunction
jaxbot commented 9 years ago

Ah, interesting. The version I have checked out on my machine is behind HEAD. I'll get this fixed for you, thanks for reporting it!

jaxbot commented 9 years ago

Updated, does this fix it for you?

sanwv commented 9 years ago

resolved,good!👍