File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -264,14 +264,18 @@ endfunction
264264
265265function ! s: create_term_buf (opts)
266266 if has (" nvim" )
267- call termopen ([g: nnn #shell , &shellcmdflag , a: opts .cmd], {' on_exit' : a: opts .on_exit })
267+ call termopen ([g: nnn #shell , &shellcmdflag , a: opts .cmd], {
268+ \ ' env' : { ' NNN_SEL' : s: temp_file },
269+ \ ' on_exit' : a: opts .on_exit
270+ \ })
268271 startinsert
269272 return bufnr (' ' )
270273 else
271274 let l: curwin = get (a: opts , ' curwin' , 1 )
272275 let l: hidden = get (a: opts , ' hidden' , 0 )
273276 let l: Exit_cb = get (a: opts , ' on_exit' )
274277 let l: tbuf = term_start ([g: nnn #shell , &shellcmdflag , a: opts .cmd], {
278+ \ ' env' : { ' NNN_SEL' : s: temp_file },
275279 \ ' curwin' : l: curwin ,
276280 \ ' hidden' : l: hidden ,
277281 \ ' exit_cb' : l: Exit_cb
@@ -366,7 +370,6 @@ function! nnn#pick(...) abort
366370 let l: sess_cfg = ' '
367371 endif
368372
369- let g: nnn #command = ' NNN_SEL=' .shellescape (s: temp_file ).' ' .g: nnn #command
370373 let l: cmd = g: nnn #command .l: sess_cfg .' -p ' .shellescape (s: temp_file ).' ' .(l: directory != ' ' ? shellescape (l: directory ): ' ' )
371374 let l: layout = exists (' l:opts.layout' ) ? l: opts .layout : g: nnn #layout
372375
You can’t perform that action at this time.
0 commit comments