Skip to content

Commit 50531a4

Browse files
committed
Make pathogen#uniq unofficial
1 parent 2d37840 commit 50531a4

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

autoload/pathogen.vim

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,6 @@ function! pathogen#legacyjoin(...) abort " {{{1
7878
return call('pathogen#join',[1] + a:000)
7979
endfunction " }}}1
8080

81-
" Remove duplicates from a list.
82-
function! pathogen#uniq(list) abort " {{{1
83-
let i = 0
84-
let seen = {}
85-
while i < len(a:list)
86-
if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
87-
call remove(a:list,i)
88-
elseif a:list[i] ==# ''
89-
let i += 1
90-
let empty = 1
91-
else
92-
let seen[a:list[i]] = 1
93-
let i += 1
94-
endif
95-
endwhile
96-
return a:list
97-
endfunction " }}}1
98-
9981
" Turn filetype detection off and back on again if it was already enabled.
10082
function! pathogen#cycle_filetype() " {{{1
10183
if exists('g:did_load_filetypes')
@@ -212,6 +194,24 @@ function! pathogen#glob_directories(pattern) abort " {{{1
212194
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
213195
endfunction "}}}1
214196

197+
" Remove duplicates from a list.
198+
function! pathogen#uniq(list) abort " {{{1
199+
let i = 0
200+
let seen = {}
201+
while i < len(a:list)
202+
if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
203+
call remove(a:list,i)
204+
elseif a:list[i] ==# ''
205+
let i += 1
206+
let empty = 1
207+
else
208+
let seen[a:list[i]] = 1
209+
let i += 1
210+
endif
211+
endwhile
212+
return a:list
213+
endfunction " }}}1
214+
215215
" Backport of fnameescape().
216216
function! pathogen#fnameescape(string) abort " {{{1
217217
if exists('*fnameescape')

0 commit comments

Comments
 (0)