Skip to content

Commit

Permalink
- Restored set winsize behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Dec 14, 2010
1 parent 9b5c6b6 commit 0849c32
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 31 deletions.
54 changes: 24 additions & 30 deletions autoload/vimshell/commands/less.vim
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,10 @@ function! s:command.execute(commands, context)"{{{
endfor
endif

" Set environment variables.
let l:environments_save = vimshell#set_variables({
\ '$TERM' : g:vimshell_environment_term,
\ '$TERMCAP' : 'COLUMNS=' . winwidth(0),
\ '$VIMSHELL' : 1,
\ '$COLUMNS' : winwidth(0)-5,
\ '$LINES' : winheight(0),
\ '$VIMSHELL_TERM' : 'less',
\ '$EDITOR' : g:vimshell_cat_command,
\ '$PAGER' : g:vimshell_cat_command,
\})

" Initialize.
let l:sub = vimproc#plineopen2(l:commands)

" Restore environment variables.
call vimshell#restore_variables(l:environments_save)

" Set variables.
let l:interactive = {
\ 'type' : 'less',
\ 'syntax' : l:options['--syntax'],
\ 'process' : l:sub,
\ 'fd' : a:context.fd,
\ 'encoding' : l:options['--encoding'],
\ 'is_pty' : 0,
Expand All @@ -95,12 +76,6 @@ function! s:command.execute(commands, context)"{{{
\ 'stdout_cache' : '',
\}

" Input from stdin.
if l:interactive.fd.stdin != ''
call l:interactive.process.stdin.write(vimshell#read(a:context.fd))
endif
call l:interactive.process.stdin.close()

return s:init(a:commands, a:context, l:options['--syntax'], l:interactive)
endfunction"}}}
function! s:command.complete(args)"{{{
Expand All @@ -120,6 +95,30 @@ function! s:init(commands, context, syntax, interactive)"{{{
" Split nicely.
call vimshell#split_nicely()

" Set environment variables.
let l:environments_save = vimshell#set_variables({
\ '$TERM' : g:vimshell_environment_term,
\ '$TERMCAP' : 'COLUMNS=' . winwidth(0),
\ '$VIMSHELL' : 1,
\ '$COLUMNS' : winwidth(0)-5,
\ '$LINES' : winheight(0),
\ '$VIMSHELL_TERM' : 'less',
\ '$EDITOR' : g:vimshell_cat_command,
\ '$PAGER' : g:vimshell_cat_command,
\})

" Initialize.
let a:interactive.process = vimproc#plineopen2(a:commands)

" Restore environment variables.
call vimshell#restore_variables(l:environments_save)

" Input from stdin.
if a:interactive.fd.stdin != ''
call a:interactive.process.stdin.write(vimshell#read(a:context.fd))
endif
call a:interactive.process.stdin.close()

let l:args = ''
for l:command in a:commands
let l:args .= join(l:command.args)
Expand Down Expand Up @@ -221,11 +220,6 @@ endfunction "}}}
function! s:print_output(line_num)"{{{
setlocal modifiable

if winwidth(0) != b:interactive.width || winheight(0) != b:interactive.height
" Set new window size.
call b:interactive.process.set_winsize(winwidth(0), winheight(0))
endif

$

if b:interactive.stdout_cache == ''
Expand Down
2 changes: 1 addition & 1 deletion doc/vimshell.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ BUGS *vimshell-bugs*
CHANGELOG *vimshell-changelog*

2010-12-14
- Supported set winsize behavior.
- Restored set winsize behavior.

2010-12-08
- Restored cd behavior.
Expand Down

0 comments on commit 0849c32

Please sign in to comment.