Skip to content

Commit

Permalink
Merge fcd56a2 into af1ae55
Browse files Browse the repository at this point in the history
  • Loading branch information
raxod502 committed Dec 28, 2019
2 parents af1ae55 + fcd56a2 commit 06a460b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rg.el
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,13 @@ If LITERAL is non nil prompt for literal string. DEFAULT is the default pattern
(let* ((file (or file default-directory))
(backend (vc-responsible-backend file)))
(vc-call-backend backend 'root file))
(error (progn
(file-name-directory file))))))
(error (if file
(or (file-name-directory file)
;; in case FILE is a relative path with no
;; directory component
default-directory)
;; in case we're not visiting any file
default-directory)))))

(defun rg-run (pattern files dir &optional literal confirm flags)
"Execute rg command with supplied PATTERN, FILES and DIR.
Expand Down

0 comments on commit 06a460b

Please sign in to comment.