diff --git a/README.rst b/README.rst index 1976a5b..39f78e5 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ Vimteractive ============ :vimteractive: send commands from text files to interactive programs via vim :Author: Will Handley -:Version: 2.4.0 +:Version: 2.4.1 :Homepage: https://github.com/williamjameshandley/vimteractive :Documentation: ``:help vimteractive`` diff --git a/autoload/vimteractive.vim b/autoload/vimteractive.vim index 65e0ccd..9b58214 100644 --- a/autoload/vimteractive.vim +++ b/autoload/vimteractive.vim @@ -90,9 +90,10 @@ function! vimteractive#sendlines(lines) " Switch to insert mode if the terminal is currently in normal mode let l:term_status = term_getstatus(b:vimteractive_connected_term) if stridx(l:term_status,"normal") != -1 + let l:current_buffer = bufnr('%') execute ":b " . b:vimteractive_connected_term execute "silent! normal! i" - bprevious + execute ":b " . l:current_buffer endif if get(g:vimteractive_bracketed_paste, l:term_type, g:vimteractive_bracketed_paste_default)