Skip to content

Commit

Permalink
Merge pull request #105 from lclrc/master
Browse files Browse the repository at this point in the history
Pass selection tempfile path env to nnn command
  • Loading branch information
mcchrish authored Jul 29, 2021
2 parents abf7001 + 5f4907c commit 523edb4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autoload/nnn.vim
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,18 @@ endfunction

function! s:create_term_buf(opts)
if has("nvim")
call termopen([g:nnn#shell, &shellcmdflag, a:opts.cmd], {'on_exit': a:opts.on_exit })
call termopen([g:nnn#shell, &shellcmdflag, a:opts.cmd], {
\ 'env': { 'NNN_SEL': s:temp_file },
\ 'on_exit': a:opts.on_exit
\ })
startinsert
return bufnr('')
else
let l:curwin = get(a:opts, 'curwin', 1)
let l:hidden = get(a:opts, 'hidden', 0)
let l:Exit_cb = get(a:opts, 'on_exit')
let l:tbuf = term_start([g:nnn#shell, &shellcmdflag, a:opts.cmd], {
\ 'env': { 'NNN_SEL': s:temp_file },
\ 'curwin': l:curwin,
\ 'hidden': l:hidden,
\ 'exit_cb': l:Exit_cb
Expand Down

0 comments on commit 523edb4

Please sign in to comment.