Permalink
Browse files

Fix append history

  • Loading branch information...
1 parent e43a7e8 commit d03bc3a2cba0424cac8aeadf1eb72aef05ade262 @Shougo committed Feb 23, 2014
Showing with 6 additions and 4 deletions.
  1. +2 −2 autoload/neocomplete/sources/vimshell_history.vim
  2. +4 −2 autoload/vimshell/history.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: vimshell_history.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 17 Feb 2014.
+" Last Modified: 23 Feb 2014.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -54,7 +54,7 @@ function! s:source.get_complete_position(context) "{{{
endfunction "}}}
function! s:source.gather_candidates(context) "{{{
- return reverse(filter(copy(vimshell#history#read()),
+ return reverse(filter(vimshell#util#uniq(vimshell#history#read()),
\ 'stridx(v:val, a:context.complete_str) >= 0'))
endfunction "}}}
@@ -55,9 +55,11 @@ function! vimshell#history#append(command) "{{{
" Reload history.
let histories = vimshell#history#read()
- " Filtering.
- let histories = vimshell#util#uniq(add(histories, command))
+ if empty(histories) || histories[-1] !=# command
+ call add(histories, command)
+ endif
+ " Filtering.
if g:vimshell_max_command_history > 0 &&
\ len(histories) > g:vimshell_max_command_history
" Truncate.

0 comments on commit d03bc3a

Please sign in to comment.