diff --git a/autoload/vimshell.vim b/autoload/vimshell.vim index ab876ae1..89618842 100644 --- a/autoload/vimshell.vim +++ b/autoload/vimshell.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: vimshell.vim " AUTHOR: Shougo Matsushita -" Last Modified: 05 Jan 2014. +" Last Modified: 06 Jan 2014. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the diff --git a/autoload/vimshell/parser.vim b/autoload/vimshell/parser.vim index 1f1f6b14..4930fbd5 100644 --- a/autoload/vimshell/parser.vim +++ b/autoload/vimshell/parser.vim @@ -234,19 +234,6 @@ function! vimshell#parser#execute_continuation(is_insert) "{{{ endif call vimshell#next_prompt(context, a:is_insert) - if b:vimshell.context.quit - if winnr('$') != 1 - if b:vimshell.context.popup - wincmd p - else - close - endif - else - call vimshell#util#alternate_buffer() - endif - - stopinsert - endif endfunction "}}} function! s:execute_statement(statement, context) "{{{ diff --git a/autoload/vimshell/view.vim b/autoload/vimshell/view.vim index f2cf473a..42427acf 100644 --- a/autoload/vimshell/view.vim +++ b/autoload/vimshell/view.vim @@ -213,7 +213,24 @@ function! vimshell#view#_next_prompt(context, ...) "{{{ if line('.') == line('$') call vimshell#print_prompt(a:context) - call vimshell#start_insert(is_insert) + if b:vimshell.context.quit + if winnr('$') != 1 + if b:vimshell.context.popup + wincmd p + else + close + endif + else + call vimshell#util#alternate_buffer() + endif + + " It is dirty hack. + " But :stopinsert does not work.. + call feedkeys("\", 'n') + else + call vimshell#start_insert(is_insert) + endif + return endif diff --git a/doc/vimshell.txt b/doc/vimshell.txt index 251211b5..fd91b6cc 100644 --- a/doc/vimshell.txt +++ b/doc/vimshell.txt @@ -939,6 +939,12 @@ OPTIONS *vimshell-options* -project Move to project directory. + *vimshell-options-quit* + -quit + Quit buffer after command finished. + If |vimshell-options-popup| is enabled, switch to previous + window. + ============================================================================== EXAMPLES *vimshell-examples* >