Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Fixed output error.

  • Loading branch information...
commit 0ed9f09ce1552fd18c8a16cc38edee0e0707ed42 1 parent 3340978
@Shougo Shougo authored
View
4 autoload/vimshell/commands/bg.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: bg.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 01 Jun 2011.
+" Last Modified: 01 Jul 2011.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -182,7 +182,7 @@ endfunction"}}}
function! s:on_execute()"{{{
setlocal modifiable
echo 'Running command.'
- call vimshell#interactive#execute_pipe_out()
+ call vimshell#interactive#execute_pipe_out(mode() ==# 'i')
redraw
echo ''
setlocal nomodifiable
View
5 autoload/vimshell/commands/exe.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: exe.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 01 Jun 2011.
+" Last Modified: 01 Jul 2011.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -65,8 +65,9 @@ function! s:command.execute(commands, context)"{{{
endif
echo 'Running command.'
+ let l:is_insert = mode() ==# 'i'
while b:interactive.process.is_valid
- call vimshell#interactive#execute_pipe_out()
+ call vimshell#interactive#execute_pipe_out(l:is_insert)
" Get input key.
let l:char = getchar(0)
View
18 autoload/vimshell/interactive.vim
@@ -245,7 +245,7 @@ function! vimshell#interactive#execute_pty_out(is_insert)"{{{
call vimshell#interactive#exit()
endif
endfunction"}}}
-function! vimshell#interactive#execute_pipe_out()"{{{
+function! vimshell#interactive#execute_pipe_out(is_insert)"{{{
if !b:interactive.process.is_valid
return
endif
@@ -572,36 +572,38 @@ function! s:check_output(interactive, bufnr, bufnr_save)"{{{
call setpos('.', a:interactive.output_pos)
endif
+ let l:is_insert = mode() ==# 'i'
+
if l:type ==# 'background'
setlocal modifiable
- call vimshell#interactive#execute_pipe_out()
+ call vimshell#interactive#execute_pipe_out(l:is_insert)
setlocal nomodifiable
elseif l:type ==# 'vimshell'
try
- call vimshell#parser#execute_continuation(mode() ==# 'i')
+ call vimshell#parser#execute_continuation(l:is_insert)
catch
" Error.
call vimshell#error_line({}, v:exception . ' ' . v:throwpoint)
let l:context = b:vimshell.continuation.context
let b:vimshell.continuation = {}
call vimshell#print_prompt(l:context)
- call vimshell#start_insert(mode() ==# 'i')
+ call vimshell#start_insert(l:is_insert)
endtry
elseif l:type ==# 'interactive' || l:type ==# 'terminal'
- if l:type ==# 'terminal' && mode() !=# 'i'
+ if l:type ==# 'terminal' && !l:is_insert
setlocal modifiable
endif
- call vimshell#interactive#execute_pty_out(mode() ==# 'i')
+ call vimshell#interactive#execute_pty_out(l:is_insert)
if l:type ==# 'terminal'
setlocal nomodifiable
- elseif !a:interactive.process.eof && mode() ==# 'i'
+ elseif !a:interactive.process.eof && l:is_insert
startinsert!
endif
endif
- if mode() !=# 'i' && l:type !=# 'vimshell'
+ if !l:is_insert && l:type !=# 'vimshell'
call setpos('.', l:intbuffer_pos)
endif
View
4 autoload/vimshell/parser.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: parser.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 30 May 2011.
+" Last Modified: 01 Jul 2011.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -153,7 +153,7 @@ function! vimshell#parser#execute_continuation(is_insert)"{{{
endif
" Execute pipe.
- call vimshell#interactive#execute_pipe_out()
+ call vimshell#interactive#execute_pipe_out(a:is_insert)
if b:interactive.process.is_valid
return 1
Please sign in to comment.
Something went wrong with that request. Please try again.