]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-cvs-annotate-time): Don't move backward when text
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 5 Jan 2008 05:19:00 +0000 (05:19 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 5 Jan 2008 05:19:00 +0000 (05:19 +0000)
gets inserted out-of-order.

lisp/ChangeLog
lisp/vc-cvs.el

index d09d12add00907fb95efbeb26716d2f9189a0d57..b6e1b937314e907ff9cabd6f6493a5fe8d2d9354 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-cvs.el (vc-cvs-annotate-time): Don't move backward when text
+       gets inserted out-of-order.
+
 2008-01-04  Riccardo Murri  <riccardo.murri@gmail.com>
 
        * vc-bzr.el: Copyright and version headers update.
index a0eb2609ade0a8e231e0f1cb0d3b5261be41539e..47507e503ce074db75105405df29e0f3e43e6e22 100644 (file)
@@ -1,7 +1,7 @@
 ;;; vc-cvs.el --- non-resident support for CVS version-control
 
 ;; Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author:      FSF (see vc.el for full credits)
 ;; Maintainer:  Andre Spiegel <spiegel@gnu.org>
@@ -629,11 +629,14 @@ systime, or nil if there is none."
          bol (1+ bol) 'vc-cvs-annotate-time
          (setq cache (cons
                       ;; Position at end makes for nicer overlay result.
-                      (match-end 0)
+                      ;; Don't put actual buffer pos here, but only relative
+                      ;; distance, so we don't ever move backward in the
+                      ;; goto-char below, even if the text is moved.
+                      (- (match-end 0) (match-beginning 0))
                       (vc-annotate-convert-time
                        (encode-time 0 0 0 day month year))))))))
     (when cache
-      (goto-char (car cache))           ; fontify from here to eol
+      (goto-char (+ bol (car cache)))   ; Fontify from here to eol.
       (cdr cache))))                    ; days (float)
 
 (defun vc-cvs-annotate-extract-revision-at-line ()