diff --git a/extensions/legit/legit-commit.lisp b/extensions/legit/legit-commit.lisp index 05c2072e5..6c2dc8ff6 100644 --- a/extensions/legit/legit-commit.lisp +++ b/extensions/legit/legit-commit.lisp @@ -27,6 +27,9 @@ Future: ;; no syntax highlihgt in fact. (setf (variable-value 'enable-syntax-highlight) t)) +(define-file-associations legit-commit-mode + ((:file-namestring "COMMIT_EDITMSG"))) + ;; User parameters. (defparameter *prompt-to-abort-commit* t "If non t, abort the current commit message without asking for confirmation.") @@ -86,7 +89,10 @@ two "If the commit message is non-empty, commit, kill the commit buffer and come back to the legit status window. Lines starting with '#' are ignored." - (let* ((message (buffer-text (make-buffer "*legit-commit*"))) + ;; The commit buffer can be: + ;; - our *legit-commit* buffer + ;; - the .git/COMMIT_EDITMSG file + (let* ((message (buffer-text (current-buffer))) (cleaned-message (clean-commit-message message))) (cond ((str:blankp cleaned-message) @@ -96,7 +102,7 @@ two (run-function (lambda () (lem/porcelain::commit vcs cleaned-message)) :message "commited") - (kill-buffer "*legit-commit*") + (kill-buffer (current-buffer)) ;; come back on the status on the left: (lem-core/commands/window:previous-window) ;; and refresh.