mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Use processed-dict, uniq() might not be available
This commit is contained in:
committed by
Andy Stewart
parent
6c2def1075
commit
d78184e646
@@ -3,7 +3,12 @@ let s:t_string = type('')
|
||||
" Primary functions {{{
|
||||
|
||||
function! gitgutter#all(force) abort
|
||||
for bufnr in uniq(sort(tabpagebuflist()))
|
||||
let processed = {}
|
||||
for bufnr in tabpagebuflist()
|
||||
if has_key(processed, bufnr)
|
||||
continue
|
||||
endif
|
||||
let processed[bufnr] = 1
|
||||
let file = expand('#'.bufnr.':p')
|
||||
if !empty(file)
|
||||
call gitgutter#init_buffer(bufnr)
|
||||
@@ -57,9 +62,13 @@ function! gitgutter#disable() abort
|
||||
for i in range(tabpagenr('$'))
|
||||
call extend(buflist, tabpagebuflist(i + 1))
|
||||
endfor
|
||||
call uniq(sort(buflist))
|
||||
|
||||
let processed = {}
|
||||
for bufnr in buflist
|
||||
if has_key(processed, bufnr)
|
||||
continue
|
||||
endif
|
||||
let processed[bufnr] = 1
|
||||
let file = expand('#'.bufnr.':p')
|
||||
if !empty(file)
|
||||
call s:clear(bufnr)
|
||||
|
||||
Reference in New Issue
Block a user