Skip to content

Commit 0890619

Browse files
authored
Merge pull request #12 from whiteinge/remove-vim-8-isms
Replace getbufinfo() and lambda for ealier versions of Vim
2 parents 16b0806 + 9327ca8 commit 0890619

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

plugin/diffconflicts.vim

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,17 @@ function! s:showHistory()
6868
endfunction
6969

7070
function! s:checkThenShowHistory()
71-
let l:xs = filter(copy(getbufinfo()), {i, x ->
72-
\ x.name =~# 'BASE' || x.name =~# 'LOCAL' || x.name =~# 'REMOTE'})
71+
let l:xs =
72+
\ filter(
73+
\ map(
74+
\ filter(
75+
\ range(1, bufnr('$')),
76+
\ 'bufexists(v:val)'
77+
\ ),
78+
\ 'bufname(v:val)'
79+
\ ),
80+
\ 'v:val =~# "BASE" || v:val =~# "LOCAL" || v:val =~# "REMOTE"'
81+
\ )
7382

7483
if (len(l:xs) < 3)
7584
echohl WarningMsg

0 commit comments

Comments
 (0)