Skip to content

Commit

Permalink
Fix file callbacks for absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewRadev committed Jul 30, 2016
1 parent c35d7d5 commit db5ef1f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions autoload/ember_tools.vim
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,19 @@ endfunction

function! ember_tools#SetFileOpenCallback(filename, ...)
let searches = a:000
let filename = fnamemodify(a:filename, ':p')

augroup ember_tools_file_open_callback
autocmd!

echomsg 'autocmd BufEnter '.a:filename.' normal! gg'
exe 'autocmd BufEnter '.a:filename.' normal! gg'
echomsg 'autocmd BufEnter '.filename.' normal! gg'
exe 'autocmd BufEnter '.filename.' normal! gg'
for pattern in searches
echomsg 'autocmd BufEnter '.a:filename.' call search("'.escape(pattern, '"\').'")'
exe 'autocmd BufEnter '.a:filename.' call search("'.escape(pattern, '"\').'")'
echomsg 'autocmd BufEnter '.filename.' call search("'.escape(pattern, '"\').'")'
exe 'autocmd BufEnter '.filename.' call search("'.escape(pattern, '"\').'")'
endfor
echomsg 'autocmd BufEnter '.a:filename.' call ember_tools#ClearFileOpenCallback()'
exe 'autocmd BufEnter '.a:filename.' call ember_tools#ClearFileOpenCallback()'
echomsg 'autocmd BufEnter '.filename.' call ember_tools#ClearFileOpenCallback()'
exe 'autocmd BufEnter '.filename.' call ember_tools#ClearFileOpenCallback()'
augroup END
endfunction

Expand Down

0 comments on commit db5ef1f

Please sign in to comment.