Skip to content

Commit

Permalink
Merge 5dcafd1 into 51596cb
Browse files Browse the repository at this point in the history
  • Loading branch information
nbarrientos committed Oct 24, 2022
2 parents 51596cb + 5dcafd1 commit a6cbe28
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rg-result.el
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ previous file with grouped matches."
(while (setq nextfile (rg-navigate-file-message nextfile nil 1))
(save-excursion
(goto-char nextfile)
(skip-chars-forward "File: ")
(and (looking-at-p "^File: ") (forward-char 6))
(setq filepath (buffer-substring-no-properties (point) (line-end-position))))
(push (cons filepath nextfile) elements))
(nreverse elements))))))
Expand Down
1 change: 1 addition & 0 deletions test/data/limenu.el
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imenu
12 changes: 12 additions & 0 deletions test/rg.el-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,18 @@ method. "
(rg-project-root "/tmp/foo.el"))
"/tmp/")))

(ert-deftest rg-integration-test/imenu-populated ()
"Test that the imenu entries are correct."
:tags '(need-rg)
(rg-run "imenu" "elisp" (concat default-directory "test/data"))
(with-current-buffer (rg-buffer-name)
(rg-wait-for-search-result)
(let ((ientries (funcall imenu-create-index-function)))
(should (equal (length ientries) 1))
(should (equal
'("limenu.el")
(seq-sort #'string-lessp (mapcar #'car ientries)))))))

(ert-deftest rg-integration/command-hiding-hide ()
"Test command hiding when `rg-hide-command` is non nil."
:tags '(need-rg)
Expand Down

0 comments on commit a6cbe28

Please sign in to comment.