Permalink
Browse files

- Fixed cd filtering.

  • Loading branch information...
1 parent dc1c218 commit bed99a9b88630062729b56ea04ffd1feb360f3bb @Shougo Shougo committed Jul 10, 2011
Showing with 7 additions and 5 deletions.
  1. +7 −5 autoload/vimshell/commands/cd.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: cd.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 10 Jul 2011.
+" Last Modified: 07 Oct 2010
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -86,11 +86,13 @@ function! s:command.execute(command, args, fd, context)"{{{
endif
endif
- " Push current directory and filtering.
- call insert(filter(b:vimshell.directory_stack, 'v:val != ' . string(l:cwd)), l:cwd)
+ if empty(b:vimshell.directory_stack) || l:cwd !=# b:vimshell.directory_stack[0]
+ " Push current directory and filtering.
+ call insert(b:vimshell.directory_stack, l:cwd)
- " Truncate.
- let b:vimshell.directory_stack = b:vimshell.directory_stack[: g:vimshell_max_directory_stack-1]
+ " Truncate.
+ let b:vimshell.directory_stack = b:vimshell.directory_stack[: g:vimshell_max_directory_stack-1]
+ endif
if a:context.is_interactive
" Call chpwd hook.

0 comments on commit bed99a9

Please sign in to comment.