Permalink
Browse files

Remove duplicated command in the history

  • Loading branch information...
itchyny committed Feb 23, 2014
1 parent 5bd7621 commit 467af39d3b0cd148d449ed495e0a4d70b1cc24dd
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 467af39

Please sign in to comment.