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 {{{
|
" Primary functions {{{
|
||||||
|
|
||||||
function! gitgutter#all(force) abort
|
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')
|
let file = expand('#'.bufnr.':p')
|
||||||
if !empty(file)
|
if !empty(file)
|
||||||
call gitgutter#init_buffer(bufnr)
|
call gitgutter#init_buffer(bufnr)
|
||||||
@@ -57,9 +62,13 @@ function! gitgutter#disable() abort
|
|||||||
for i in range(tabpagenr('$'))
|
for i in range(tabpagenr('$'))
|
||||||
call extend(buflist, tabpagebuflist(i + 1))
|
call extend(buflist, tabpagebuflist(i + 1))
|
||||||
endfor
|
endfor
|
||||||
call uniq(sort(buflist))
|
|
||||||
|
|
||||||
|
let processed = {}
|
||||||
for bufnr in buflist
|
for bufnr in buflist
|
||||||
|
if has_key(processed, bufnr)
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
let processed[bufnr] = 1
|
||||||
let file = expand('#'.bufnr.':p')
|
let file = expand('#'.bufnr.':p')
|
||||||
if !empty(file)
|
if !empty(file)
|
||||||
call s:clear(bufnr)
|
call s:clear(bufnr)
|
||||||
|
|||||||
Reference in New Issue
Block a user