diff options
author | Matthew Kosarek <matt.kosarek@canonical.com> | 2024-11-22 08:40:22 -0500 |
---|---|---|
committer | Matthew Kosarek <matt.kosarek@canonical.com> | 2024-11-22 08:40:22 -0500 |
commit | 625ddd169d517344737a7cffbec646df5028651b (patch) | |
tree | ed4a901d981830eccb813fbcc8d3d6866d5a04b6 /lisp/vc-annotate-lens-mode.el | |
parent | 58f216225499816ba0e5486e2548725065a27c36 (diff) |
Diffstat (limited to 'lisp/vc-annotate-lens-mode.el')
-rw-r--r-- | lisp/vc-annotate-lens-mode.el | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/lisp/vc-annotate-lens-mode.el b/lisp/vc-annotate-lens-mode.el deleted file mode 100644 index b615a1b..0000000 --- a/lisp/vc-annotate-lens-mode.el +++ /dev/null @@ -1,50 +0,0 @@ -;;; Code: - -;;; Commit -;; commit 6257322d751dc36eaaf509682da164f6aef3ff90 -;; Author: Matthew Kosarek <mattkae@protonmail.com> -;; Date: Sat Sep 3 12:01:26 2022 -0400 - -;; Big upgrade to javascript/typescript to use a lanugage server - -;; diff --git a/init.el b/init.el -;; --- a/init.el -;; +++ b/init.el - - -(make-variable-buffer-local - (defvar vc-annotate-lens-cursor-position 0 - "Holds the cursor position from the last run of post-command-hooks.")) - -(defun do-stuff-if-moved-post-command () - "Show version control history of the current line in a flash." - (unless (equal (line-number-at-pos) vc-annotate-lens-cursor-position) - (setq vc-annotate-lens-cursor-position (line-number-at-pos))) - - (remove-overlays) ; TODO: Only remove the overlay that we last displayed - - (let ((git-info (shell-command-to-string (format "git log -u -L%d,%d:%s" vc-annotate-lens-cursor-position vc-annotate-lens-cursor-position buffer-file-name)))) - - (let (( git-info-split (split-string git-info "\n" ))) - (let ( - ( commit-line (nth 0 git-info-split)) - ( author-line (nth 1 git-info-split)) - ( date-line (nth 2 git-info-split))) - (overlay-put (make-overlay (point-at-eol) (+ 3 (point-at-eol))) 'display (format " %s\n" author-line)) - ) - ) - ) - ) - - - (define-minor-mode vc-annotate-lens-mode - "Show 'vc-annotate' information when you move to a line." - :lighter " vc-annotate-lens" - ) - - (add-hook 'vc-annotate-lens-mode-on-hook (lambda () (add-hook 'post-command-hook #'do-stuff-if-moved-post-command))) - (add-hook 'vc-annotate-lens-mode-off-hook (lambda () (remove-hook 'post-command-hook #'do-stuff-if-moved-post-command))) - - (provide 'vc-annotate-lens-mode) -;;; vc-annotate-lens-mode.el ends here. - |