Skip to content

Commit

Permalink
Adding special conditions to the interactive module
Browse files Browse the repository at this point in the history
The current code always assume there is a 'b:interactive' variable set on
the environment. This is not the case when we are using the statement

'b:interactive.is_close_immediately = 1'

It did complain at some point that the variable was non-existing, I added
an if statement that checked if the variable was there, before doing
anything.
  • Loading branch information
roman committed Jul 21, 2011
1 parent a1ed731 commit 7d69e37
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autoload/vimshell/hook.vim
Expand Up @@ -25,6 +25,13 @@
"=============================================================================

function! vimshell#hook#call(hook_point, context, args)"{{{
" There are cases when this variable doesn't
" exist
" USE: 'b:interactive.is_close_immediately = 1' to replicate
if !exists('b:interactive')
return
end

if !a:context.is_interactive
\ || !has_key(b:interactive.hook_functions_table, a:hook_point)
return
Expand Down
7 changes: 7 additions & 0 deletions autoload/vimshell/interactive.vim
Expand Up @@ -293,6 +293,13 @@ function! vimshell#interactive#execute_pipe_out(is_insert)"{{{
endif
endfunction"}}}
function! s:set_output_pos(is_insert)"{{{
" There are cases when this variable doesn't
" exist
" USE: 'b:interactive.is_close_immediately = 1' to replicate
if !exists('b:interactive')
return
end

if b:interactive.type !=# 'terminal' &&
\ has_key(b:interactive.process, 'eof') && !b:interactive.process.eof
if a:is_insert
Expand Down

0 comments on commit 7d69e37

Please sign in to comment.