Skip to content

Commit

Permalink
capture windows NVIM_APPNAME in batch script
Browse files Browse the repository at this point in the history
  • Loading branch information
Beastwick18 authored and glacambre committed Jun 30, 2024
1 parent 992e576 commit c6e3747
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit c6e3747

Please sign in to comment.