Refactor open_buffers() pt2

This commit is contained in:
Marco Hinz 2013-08-09 13:15:33 +02:00
parent a71514a97b
commit d9b44f32f7

View file

@ -368,12 +368,11 @@ endfunction
" Function: s:open_buffers {{{1 " Function: s:open_buffers {{{1
function! s:open_buffers(cword) abort function! s:open_buffers(cword) abort
" markers found; open one or more buffers
if exists('s:marked') && !empty(s:marked) if exists('s:marked') && !empty(s:marked)
enew enew
setlocal nobuflisted setlocal nobuflisted
" markers found; open one or more buffers
if exists('s:marked') && !empty(s:marked)
for val in values(s:marked) for val in values(s:marked)
let [path, type] = val[1:2] let [path, type] = val[1:2]
" open in split " open in split
@ -394,17 +393,16 @@ function! s:open_buffers(cword) abort
else else
execute 'edit' path execute 'edit' path
endif endif
continue
endfor endfor
" remove markers for next instance of :Startify
if exists('s:marked')
unlet s:marked
endif
" no markers found; open a single buffer " no markers found; open a single buffer
else else
execute 'normal' a:cword execute 'normal' a:cword
endif endif
endif
if exists('s:marked')
unlet s:marked
endif
endfunction endfunction
" Function: s:close {{{1 " Function: s:close {{{1