emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/go-mode 7c50c80 410/495: Always move back to same column a


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 7c50c80 410/495: Always move back to same column after applying rcs patch
Date: Sat, 7 Aug 2021 09:05:58 -0400 (EDT)

branch: elpa/go-mode
commit 7c50c800bc06f7e3b2f2d3fc0410e2cea78a5cb3
Author: mschuldt <mbschuldt@gmail.com>
Commit: Dominik Honnef <dominik@honnef.co>

    Always move back to same column after applying rcs patch
    
    Previously the point would move to the beginning of the line if the
    current line was changed by gofmt because save-execution stores a text
    marker instead of a buffer position.
    
    Closes: gh-236 [via git-merge-pr]
---
 go-mode.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index cde0b72..cfcf42b 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -1029,7 +1029,8 @@ with goflymake \(see URL 
`https://github.com/dougm/goflymake'), gocode
         ;; Appending lines decrements the offset (possibly making it
         ;; negative), deleting lines increments it. This order
         ;; simplifies the forward-line invocations.
-        (line-offset 0))
+        (line-offset 0)
+        (column (current-column)))
     (save-excursion
       (with-current-buffer patch-buffer
         (goto-char (point-min))
@@ -1056,7 +1057,8 @@ with goflymake \(see URL 
`https://github.com/dougm/goflymake'), gocode
                 (cl-incf line-offset len)
                 (go--delete-whole-line len)))
              (t
-              (error "Invalid rcs patch or internal error in 
go--apply-rcs-patch")))))))))
+              (error "Invalid rcs patch or internal error in 
go--apply-rcs-patch")))))))
+    (move-to-column column)))
 
 (defun gofmt--is-goimports-p ()
   (string-equal (file-name-base gofmt-command) "goimports"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]