From befb207b48e631b3c5855e12900387e69b03dc5c Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 12 Dec 2016 22:27:56 -0500 Subject: git-rebase-fixup-duplicates: Use marker If only an integer is used, the end value used for the search is no longer accurate because more characters are inserted for each line where "fixup" or "squash" is substituted for "pick". This discrepancy is unlikely to have an observable effect when git-rebase-show-instructions is non-nil because the end value includes many characters beyond the last commit line. But when git-rebase-show-instructions is nil, this can easily result in the last commit line not matching the regexp because the end value has shifted to the middle of the line. --- lisp/km-magit.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lisp') diff --git a/lisp/km-magit.el b/lisp/km-magit.el index cba378d..0fae81e 100644 --- a/lisp/km-magit.el +++ b/lisp/km-magit.el @@ -655,6 +655,8 @@ If prefix argument SQUASH is non-nil, mark for squashing instead of fixing up." (interactive (nconc (km/region-or-buffer-line-bounds) (list current-prefix-arg))) + (unless (markerp end) + (setq end (copy-marker end))) (save-excursion (goto-char beg) (let ((prefix (if squash "squash" "fixup")) -- cgit v1.2.3