summaryrefslogtreecommitdiff
path: root/lisp/vc-annotate-lens-mode.el
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2022-11-28 08:18:55 -0500
committermattkae <mattkae@protonmail.com>2022-11-28 08:18:55 -0500
commit2e006908657ede8590b3fa5544fb05ffec061fc6 (patch)
tree38476af663e2c0bcfac174e1ba343a48c217bb76 /lisp/vc-annotate-lens-mode.el
parent355bab6730c5a20ee45f323507c217e37b157a4d (diff)
Copy all function
Diffstat (limited to 'lisp/vc-annotate-lens-mode.el')
-rw-r--r--lisp/vc-annotate-lens-mode.el20
1 files changed, 17 insertions, 3 deletions
diff --git a/lisp/vc-annotate-lens-mode.el b/lisp/vc-annotate-lens-mode.el
index 00f674e..830f568 100644
--- a/lisp/vc-annotate-lens-mode.el
+++ b/lisp/vc-annotate-lens-mode.el
@@ -6,10 +6,23 @@
"Holds the cursor position from the last run of post-command-hooks."))
(defun do-stuff-if-moved-post-command ()
- (interactive)
+ "Show version control history of the current line in a flash."
(unless (equal (line-number-at-pos) vc-annotate-lens-cursor-position)
- (vc-region-history line-number-at-pos)
- (message "%s" vc-annotate-lens-cursor-position))
+ (remove-overlays)
+ (overlay-put (make-overlay (point-at-eol) (+ 3 (point-at-eol))) 'display "Hello world\n")
+ (let* ((lfrom (line-number-at-pos (point) t))
+ (lto (line-number-at-pos (1- (point)) t))
+ (file buffer-file-name)
+ (backend (vc-backend file))
+ (buf (get-buffer-create "*VC_LENS*")))
+
+ (vc-call region-history (buffer-file-name) buf lfrom lto)
+ (with-current-buffer buf
+ (save-restriction
+ (widen)
+ (buffer-substring-no-properties (point-min) (point-max))))
+ )
+ )
(setq vc-annotate-lens-cursor-position (line-number-at-pos)))
(define-minor-mode vc-annotate-lens-mode
@@ -22,3 +35,4 @@
(provide 'vc-annotate-lens-mode)
;;; vc-annotate-lens-mode.el ends here.
+