Skip to content

Commit

Permalink
Revert "Use :argdo instead of :bufdo in s:startup"
Browse files Browse the repository at this point in the history
This reverts commit bcada53.

This fix bogado#56
  • Loading branch information
utix committed Oct 9, 2015
1 parent a1381d0 commit 5b44ff1
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions plugin/file_line.vim
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,20 @@ function! s:gotoline()
let line_num = l:names[2] == ''? '0' : l:names[2]
let col_num = l:names[3] == ''? '0' : l:names[3]
call s:reopenAndGotoLine(file_name, line_num, col_num)
return file_name
break
endif
endfor
endfunction

" Handle entry in the argument list.
" This is called via `:argdo` when entering Vim.
function! s:handle_arg()
let argname = expand('%')
let fname = s:gotoline()
if fname != argname
let argidx = argidx()
exec (argidx+1).'argdelete'
exec (argidx)'argadd' fname
endif
endfunction

function! s:startup()
function s:startup()
autocmd! BufNewFile * nested call s:gotoline()
autocmd! BufRead * nested call s:gotoline()

if argc() > 0
let argidx=argidx()
argdo call s:handle_arg()
exec (argidx+1).'argument'
" Manually call Syntax autocommands, ignored by `:argdo`.
doautocmd Syntax
silent! bufdo call s:gotoline()
silent! bfirst
doautocmd FileType
doautocmd BufEnter
if &diff
diffthis
endif
endfunction

Expand Down

0 comments on commit 5b44ff1

Please sign in to comment.