Skip to content

Commit 523edb4

Browse files
authored
Merge pull request #105 from lclrc/master
Pass selection tempfile path env to nnn command
2 parents abf7001 + 5f4907c commit 523edb4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

autoload/nnn.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,18 @@ endfunction
264264

265265
function! 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

0 commit comments

Comments
 (0)