Permalink
Browse files

Add quit option

  • Loading branch information...
1 parent 45f4b9c commit 2cdbd6ed7ac53c43f215cbfa35dd446df9a60050 @Shougo committed Jan 5, 2014
Showing with 25 additions and 15 deletions.
  1. +1 −1 autoload/vimshell.vim
  2. +0 −13 autoload/vimshell/parser.vim
  3. +18 −1 autoload/vimshell/view.vim
  4. +6 −0 doc/vimshell.txt
View
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: vimshell.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" 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
@@ -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) "{{{
View
@@ -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("\<ESC>", 'n')
+ else
+ call vimshell#start_insert(is_insert)
+ endif
+
return
endif
View
@@ -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*
>

0 comments on commit 2cdbd6e

Please sign in to comment.