Skip to content

Commit

Permalink
Add quit option
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Jan 5, 2014
1 parent 45f4b9c commit 2cdbd6e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion autoload/vimshell.vim
@@ -1,7 +1,7 @@
"============================================================================= "=============================================================================
" FILE: vimshell.vim " FILE: vimshell.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com> " AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 05 Jan 2014. " Last Modified: 06 Jan 2014.
" License: MIT license {{{ " License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining " Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the " a copy of this software and associated documentation files (the
Expand Down
13 changes: 0 additions & 13 deletions autoload/vimshell/parser.vim
Expand Up @@ -234,19 +234,6 @@ function! vimshell#parser#execute_continuation(is_insert) "{{{
endif endif


call vimshell#next_prompt(context, a:is_insert) 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 endfunction
"}}} "}}}
function! s:execute_statement(statement, context) "{{{ function! s:execute_statement(statement, context) "{{{
Expand Down
19 changes: 18 additions & 1 deletion autoload/vimshell/view.vim
Expand Up @@ -213,7 +213,24 @@ function! vimshell#view#_next_prompt(context, ...) "{{{
if line('.') == line('$') if line('.') == line('$')
call vimshell#print_prompt(a:context) 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("\<ESC>", 'n')
else
call vimshell#start_insert(is_insert)
endif

return return
endif endif


Expand Down
6 changes: 6 additions & 0 deletions doc/vimshell.txt
Expand Up @@ -939,6 +939,12 @@ OPTIONS *vimshell-options*
-project -project
Move to project directory. 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* EXAMPLES *vimshell-examples*
> >
Expand Down

0 comments on commit 2cdbd6e

Please sign in to comment.