Clean up require errors on gf and ]d

This commit is contained in:
Tim Pope 2013-04-10 22:33:48 -04:00
parent 7b334ef5a3
commit 21d5c81eab

View File

@ -475,7 +475,7 @@ function! s:qfentry(entry) abort
let a:entry.tempfile = s:temp_response(a:entry.response) let a:entry.tempfile = s:temp_response(a:entry.response)
endif endif
let s:qffiles[a:entry.tempfile] = a:entry let s:qffiles[a:entry.tempfile] = a:entry
return {'filename': a:entry.tempfile, 'text': a:entry.code} return {'filename': a:entry.tempfile, 'text': a:entry.code, 'type': 'E'}
endfunction endfunction
function! s:qfhistory() abort function! s:qfhistory() abort
@ -486,6 +486,7 @@ function! s:qfhistory() abort
endif endif
call extend(list, [s:qfentry(entry)]) call extend(list, [s:qfentry(entry)])
endfor endfor
let g:list = list
return list return list
endfunction endfunction
@ -813,7 +814,7 @@ endfunction
augroup fireplace_eval augroup fireplace_eval
autocmd! autocmd!
autocmd FileType clojure call s:setup_eval() autocmd FileType clojure call s:setup_eval()
autocmd BufReadPost * if has_key(s:qffiles, expand('<afile>:p')) | autocmd BufReadPost * if has_key(s:qffiles, expand('<amatch>:p')) |
\ call s:setup_historical() | \ call s:setup_historical() |
\ endif \ endif
autocmd CmdWinEnter @ if exists('s:input') | call s:cmdwinenter() | endif autocmd CmdWinEnter @ if exists('s:input') | call s:cmdwinenter() | endif
@ -873,6 +874,7 @@ function! fireplace#source(symbol) abort
endfunction endfunction
function! s:Edit(cmd, keyword) abort function! s:Edit(cmd, keyword) abort
try
if a:keyword =~# '^\k\+/$' if a:keyword =~# '^\k\+/$'
let location = fireplace#findfile(a:keyword[0: -2]) let location = fireplace#findfile(a:keyword[0: -2])
elseif a:keyword =~# '^\k\+\.[^/.]\+$' elseif a:keyword =~# '^\k\+\.[^/.]\+$'
@ -880,6 +882,9 @@ function! s:Edit(cmd, keyword) abort
else else
let location = fireplace#source(a:keyword) let location = fireplace#source(a:keyword)
endif endif
catch /^Clojure:/
return ''
endtry
if location !=# '' if location !=# ''
if matchstr(location, '^+\d\+ \zs.*') ==# expand('%:p') && a:cmd ==# 'edit' if matchstr(location, '^+\d\+ \zs.*') ==# expand('%:p') && a:cmd ==# 'edit'
return matchstr(location, '\d\+') return matchstr(location, '\d\+')
@ -955,7 +960,11 @@ function! s:GF(cmd, file) abort
else else
let file = a:file let file = a:file
endif endif
try
let file = fireplace#findfile(file) let file = fireplace#findfile(file)
catch /^Clojure:/
return ''
endtry
if file ==# '' if file ==# ''
let v:errmsg = "Couldn't find file for ".a:file let v:errmsg = "Couldn't find file for ".a:file
return 'echoerr v:errmsg' return 'echoerr v:errmsg'