Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove duplicated command in the history

  • Loading branch information...
commit 467af39d3b0cd148d449ed495e0a4d70b1cc24dd 1 parent 5bd7621
@itchyny itchyny authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 autoload/vimshell/history.vim
View
6 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.
Please sign in to comment.
Something went wrong with that request. Please try again.