11" =============================================================================
22" FILE: bg.vim
33" AUTHOR: Shougo Matsushita <[email protected] >4- " Last Modified: 25 Dec 2009
4+ " Last Modified: 05 Feb 2010
55" License: MIT license {{{
66" Permission is hereby granted, free of charge, to any person obtaining
77" a copy of this software and associated documentation files (the
2222" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2323" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2424" }}}
25- " Version: 1.15 , for Vim 7.0
25+ " Version: 1.16 , for Vim 7.0
2626" -----------------------------------------------------------------------------
2727" ChangeLog: "{{{
28+ " 1.16:
29+ " - Improved filetype.
30+ " - Improved update.
31+ "
2832" 1.15:
2933" - Improved kill processes.
3034" - Use vimproc.vim.
@@ -113,7 +117,7 @@ function! vimshell#internal#bg#execute(program, args, fd, other_info)"{{{
113117endfunction " }}}
114118
115119function ! vimshell#internal#bg#vimshell_bg (args )" {{{
116- call vimshell#internal#bg#execute (' bg' , a: args , {' stdin' : ' ' , ' stdout' : ' ' , ' stderr' : ' ' }, {' is_interactive' : 0 , ' is_background' : 1 })
120+ call vimshell#internal#bg#execute (' bg' , vimshell#parser#split_args ( a: args) , {' stdin' : ' ' , ' stdout' : ' ' , ' stderr' : ' ' }, {' is_interactive' : 0 , ' is_background' : 1 })
117121endfunction " }}}
118122
119123function ! s: init_bg (fd, args , is_interactive)" {{{
@@ -175,7 +179,7 @@ function! s:init_bg(fd, args, is_interactive)"{{{
175179 setlocal buftype = nofile
176180 setlocal noswapfile
177181 setlocal nowrap
178- execute ' setfiletype ' . a: args [ 0 ]
182+ setfiletype background
179183
180184 " Set syntax.
181185 syn region VimShellError start =+ !!!+ end =+ !!!+ contains =VimShellErrorHidden oneline
@@ -197,8 +201,7 @@ function! s:init_bg(fd, args, is_interactive)"{{{
197201 endif
198202 endif
199203
200- autocmd vimshell_bg BufUnload <buffer> call <SID> on_exit ()
201- autocmd vimshell_bg CursorHold <buffer> call <SID> on_execute ()
204+ autocmd vimshell_bg BufUnload <buffer> call s: on_exit ()
202205 nnoremap <buffer> <silent><C-c> :<C-u> call vimshell#interactive#interrupt()<CR>
203206 inoremap <buffer> <silent><C-c> <ESC> :<C-u> call <SID> on_exit()<CR>
204207 nnoremap <buffer> <silent><CR> :<C-u> call <SID> on_execute()<CR>
@@ -216,7 +219,6 @@ endfunction
216219
217220function ! s: on_exit ()
218221 augroup vimshell_bg
219- autocmd ! CursorHold <buffer>
220222 autocmd ! BufUnload <buffer>
221223 augroup END
222224
0 commit comments