From f6de4198f4edfda6468e10d55123e823528543f5 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 1 Jul 2017 00:45:22 -0400 Subject: diff-review: Add open-line variant --- lisp/km-diff.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lisp') diff --git a/lisp/km-diff.el b/lisp/km-diff.el index f1801e9..19afba9 100644 --- a/lisp/km-diff.el +++ b/lisp/km-diff.el @@ -83,6 +83,7 @@ (define-key map (kbd "C-w") #'km/diff-review-copy-comment) (define-key map (kbd "C-c C-n") #'km/diff-review-next-comment) (define-key map (kbd "C-c C-p") #'km/diff-review-previous-comment) + (define-key map (kbd "M-o") #'km/diff-review-open-line) map) "Keymap for Diff Review mode.") @@ -202,5 +203,18 @@ If N is negative, move to forward instead." (interactive "p") (km/diff-review-next-comment (- n))) +(defun km/diff-review-open-line () + "Insert a comment line above point. +If point is currently on a comment block, insert a single line. +Otherwise, insert a block of three comment lines and position +point at the middle line." + (interactive) + (goto-char (point-at-bol)) + (if (eq ?: (char-after)) + (progn (insert ": \n") + (backward-char)) + (insert ": \n: \n: \n") + (backward-char 4))) + (provide 'km-diff) ;;; km-diff.el ends here -- cgit v1.2.3