diff --git a/README.md b/README.md index 26446ab..a4d9d43 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,24 @@ configure the endpoint of your GitHub Enterprise installation, this should look `github-review-view-comments-in-code-lines-outdated` to `t`, however we cannot guarantee correct placement of these comments in the review buffer. + You can also enable replies to inline comments by setting + `github-review-reply-inline-comments` to `t`, this feature only works if + `github-review-view-comments-in-code-lines` is also set to `t`. This way, if + you include a comment right after a previous received comment in the diff + buffer, your new comment will be sent as a reply. + +- By default, `github-review` does not allow you to move back and forth the diff + buffer and the actual source code. + You can define a list of projects and the respective directory location to + enable `diff-goto-source` (bound to `C-c c-c` by default) e.g.: + ```elisp + + (setq github-review-projects-worktree + '(("charignon/github-review". "~/.doom.d/sources/github-review") + ("magit/forge" . "~/code/oss/magit-forge"))) + + ``` + ## Notice *I am providing code in the repository to you under an open source license. Because this is my personal repository, the license you receive to my diff --git a/github-review.el b/github-review.el index 5a9c9e3..7504534 100644 --- a/github-review.el +++ b/github-review.el @@ -68,6 +68,9 @@ "Flag to enable displaying outdated comments in code lines." :group 'github-review) +(defcustom github-review-projects-worktree () + "Define directory path for your projects to be used by `diff-goto-source'. ") + (defconst github-review-diffheader '(("Accept" . "application/vnd.github.v3.diff")) "Header for requesting diffs from GitHub.") @@ -329,7 +332,15 @@ ACC is an alist accumulating parsing state." (erase-buffer) (insert diff) (save-buffer) - (github-review-mode))) + (github-review-mode) + + ;; Use `C-c C-c' in diff-mode to go to source code + (when-let ((repo-path (alist-get + (format "%s/%s" .owner .repo) + github-review-projects-worktree + nil nil 'equal))) + (setq diff-remembered-defdir repo-path) + (setq default-directory repo-path)))) (defun github-review-parsed-review-from-current-buffer () "Return a code review given the current buffer containing a diff."