Commits

ZyX_I committed 367f213

@aurum: Restored old behavior (set qf list to empty if no matching files found)

Comments (0)

Files changed (1)

             \'\Vcmd\s\+type ""',  'cmd '.s:_r.comp.cmd,  ''),
             \'\Vrev\s\+type ""',  'rev '.s:_r.comp.rev,  ''))
 "▶1 grepfunc
+function s:F.setlist(opts, list)
+    if has_key(a:opts, 'location')
+        return setloclist(a:opts.location, a:list)
+    else
+        return setqflist(a:list)
+    endif
+endfunction
 function s:grepfunc.function(pattern, opts)
     if has_key(a:opts, 'files') && a:opts.repo is# ':'
         let repo=s:_r.repo.get(a:opts.files[0])
         endfor
         if empty(files)
             call s:_f.warn('nogf')
-            return
+            return s:F.setlist(a:opts, [])
         endif
     endif
     let wdfiles=((has_key(a:opts, 'wdfiles'))?(a:opts.wdfiles):
         let item.filename=s:_r.fname('file', repo, item.filename[0],
                     \                item.filename[1])
     endfor
-    if has_key(a:opts, 'location')
-        return setloclist(a:opts.location, qf)
-    else
-        return setqflist(qf)
-    endif
+    return s:F.setlist(a:opts, qf)
 endfunction
 let s:grepfunc['@FWC']=['-onlystrings '.
             \           'type "" '.