Skip to content

Commit 6c2def1

Browse files
blueyedairblade
authored andcommitted
Use sort+uniq with tabpagebuflist to remove duplicates
1 parent 4931dd1 commit 6c2def1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

autoload/gitgutter.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ let s:t_string = type('')
33
" Primary functions {{{
44

55
function! gitgutter#all(force) abort
6-
for bufnr in tabpagebuflist()
6+
for bufnr in uniq(sort(tabpagebuflist()))
77
let file = expand('#'.bufnr.':p')
88
if !empty(file)
99
call gitgutter#init_buffer(bufnr)
@@ -57,6 +57,7 @@ function! gitgutter#disable() abort
5757
for i in range(tabpagenr('$'))
5858
call extend(buflist, tabpagebuflist(i + 1))
5959
endfor
60+
call uniq(sort(buflist))
6061

6162
for bufnr in buflist
6263
let file = expand('#'.bufnr.':p')

0 commit comments

Comments
 (0)