Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture NVIM_APPNAME on Windows during batch script installation #1622

Merged
merged 1 commit into from
Jun 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions autoload/firenvim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,16 @@ function! s:capture_env_var(var) abort
\"fi\n"
endfunction

function! s:capture_windows_env_var(var) abort
let l:value = eval('$' . a:var)
if l:value ==? ''
return ''
endif
return 'if NOT DEFINED ' . a:var . ' (' . "\r\n" .
\' set "' . a:var . '=' . l:value . '"' . "\r\n" .
\")\r\n"
endfunction

function! s:get_executable_content(data_dir, prolog) abort
let l:stdioopen = ''
if api_info().version.major > 0 || api_info().version.minor > 6
Expand Down Expand Up @@ -669,6 +679,7 @@ function! s:get_executable_content(data_dir, prolog) abort
return "@echo off\r\n" .
\ "mkdir \"" . l:dir . "\" 2>nul\r\n" .
\ "cd \"" . l:dir . "\"\r\n" .
\ s:capture_windows_env_var('NVIM_APPNAME') .
\ a:prolog . "\r\n" .
\ l:wsl_prefix . ' "' . s:get_progpath() . '" --headless ' . l:stdioopen . ' --cmd "let g:started_by_firenvim = v:true" -c "call firenvim#run()"' . "\r\n"
endif
Expand Down
Loading