Permalink
Browse files

Merge pull request #132 from itchyny/master

Remove duplicated command in the history
  • Loading branch information...
2 parents 5bd7621 + 467af39 commit fb70f8c63fa913b372ee9938196e4bd2cda26e38 @Shougo committed Feb 23, 2014
Showing with 2 additions and 4 deletions.
  1. +2 −4 autoload/vimshell/history.vim
@@ -55,11 +55,9 @@ function! vimshell#history#append(command) "{{{
" Reload history.
let histories = vimshell#history#read()
- if empty(histories) || histories[-1] !=# command
- call add(histories, command)
- endif
-
" Filtering.
+ let histories = add(filter(histories, "v:val !=# command"), command)
+
if g:vimshell_max_command_history > 0 &&
\ len(histories) > g:vimshell_max_command_history
" Truncate.

0 comments on commit fb70f8c

Please sign in to comment.