Commits

ZyX_I committed 66c101b

@aurum: Added location list support to :AuGrep

Comments (0)

Files changed (2)

                    should be searched for. May be specified more then once.
     files          Glob. Determines which files should be searched. May be 
                    specified more then once.
+    location       Number from the range 0 .. winnr('$') (|winnr()|). If this 
+                   argument is specified, AuGrep will use |location-list| for 
+                   the given window (current in case it is 0) instead of the 
+                   quickfix list.
     repo           Path. Repository that should be searched.
     [no]wdfiles    Flag. Determines whether :AuGrep should output files in 
                    working directory if they have not changed since found 
         endfor
         if empty(files)
             call s:_f.warn('nogf')
-            call setqflist([])
             return
         endif
     endif
         let item.filename=s:_r.fname('file', repo, item.filename[0],
                     \                item.filename[1])
     endfor
-    call setqflist(qf)
+    if has_key(a:opts, 'location')
+        return setloclist(a:opts.location, qf)
+    else
+        return setqflist(qf)
+    endif
 endfunction
 let s:grepfunc['@FWC']=['-onlystrings '.
             \           'type "" '.
             \           ' ?*+2 revrange   type ""  type ""'.
             \           ' ?*   revision   type ""'.
             \           ' ?*   files      type ""'.
+            \           ' ?    location   range 0 $=winnr("$")'.
             \           ' ?   !workmatch'.
             \           ' ?   !wdfiles'.
             \           ' ?   !ignorecase '.