depot/third_party/nixpkgs/pkgs/misc/vim-plugins/markdown-preview-nvim/fix-node-paths.patch
Default email 818c48e259 Project import generated by Copybara.
GitOrigin-RevId: 14aef06d9b3ad1d07626bdbb16083b83f92dc6c1
2021-10-04 09:37:57 -03:00

46 lines
2.2 KiB
Diff

diff --git a/autoload/health/mkdp.vim b/autoload/health/mkdp.vim
index 9eebb56..0700333 100644
--- a/autoload/health/mkdp.vim
+++ b/autoload/health/mkdp.vim
@@ -9,8 +9,8 @@ function! health#mkdp#check() abort
call health#report_info('Pre build: ' . l:mkdp_server_script)
call health#report_info('Pre build version: ' . mkdp#util#pre_build_version())
call health#report_ok('Using pre build')
- elseif executable('node')
- call health#report_info('Node version: ' . system('node --version'))
+ else
+ call health#report_info('Node version: ' . system('@node@ --version'))
let l:mkdp_server_script = s:mkdp_root_dir . '/app/server.js'
call health#report_info('Script: ' . l:mkdp_server_script)
call health#report_info('Script exists: ' . filereadable(l:mkdp_server_script))
diff --git a/autoload/mkdp/nvim/rpc.vim b/autoload/mkdp/nvim/rpc.vim
index 5abd807..db1067b 100644
--- a/autoload/mkdp/nvim/rpc.vim
+++ b/autoload/mkdp/nvim/rpc.vim
@@ -53,8 +53,8 @@ function! mkdp#nvim#rpc#get_command() abort
let l:pre_build = s:root_dir . '/app/bin/markdown-preview-' . mkdp#util#get_platform()
if executable(l:pre_build)
let l:cmd = [l:pre_build, '--path', s:script]
- elseif executable('node')
- let l:cmd = ['node', s:root_dir . '/app/index.js', '--path', s:script]
+ else
+ let l:cmd = ['@node@', s:root_dir . '/app/index.js', '--path', s:script]
endif
if !exists('l:cmd')
echohl Error | echon '[vim-node-rpc] pre build and node not found!' | echohl None
diff --git a/autoload/mkdp/rpc.vim b/autoload/mkdp/rpc.vim
index a3361ec..d42f7a6 100644
--- a/autoload/mkdp/rpc.vim
+++ b/autoload/mkdp/rpc.vim
@@ -59,9 +59,9 @@ function! mkdp#rpc#start_server() abort
let l:mkdp_server_script = s:mkdp_root_dir . '/app/bin/markdown-preview-' . mkdp#util#get_platform()
if executable(l:mkdp_server_script)
let l:cmd = [l:mkdp_server_script, '--path', s:mkdp_root_dir . '/app/server.js']
- elseif executable('node')
+ else
let l:mkdp_server_script = s:mkdp_root_dir . '/app/index.js'
- let l:cmd = ['node', l:mkdp_server_script, '--path', s:mkdp_root_dir . '/app/server.js']
+ let l:cmd = ['@node@', l:mkdp_server_script, '--path', s:mkdp_root_dir . '/app/server.js']
endif
if exists('l:cmd')
if s:is_vim