Skip to content

Commit

Permalink
feat: allow jumping to globs in source files
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpeck committed Apr 19, 2024
1 parent a8b93b7 commit ae5d162
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hog.el
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,15 @@ The resulting list is of the form:
(defun hog-follow-link-at-point ()
"Follow the Hog source file at point."
(interactive)
;; TODO: check if the file contains a wildcard suffix, if so open it as a directory
(let ((file-with-path (hog--get-link-at-point)))

(when (file-exists-p file-with-path)
(find-file file-with-path))))
(find-file file-with-path))

;; check if the file contains a wildcard suffix, if so open it as a directory
(when (file-expand-wildcards file-with-path)
(find-file (file-name-directory
(car (file-expand-wildcards file-with-path)))))))

(defun hog-expand-glob-at-point ()
"Unglob a globbed entry in a source file.
Expand Down

0 comments on commit ae5d162

Please sign in to comment.