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

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

[nongnu] elpa/go-mode a5d5039 161/495: use go--goto-line where applicabl


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode a5d5039 161/495: use go--goto-line where applicable
Date: Sat, 7 Aug 2021 09:05:04 -0400 (EDT)

branch: elpa/go-mode
commit a5d503964b4b699450304c46ed082626bd727f37
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>

    use go--goto-line where applicable
---
 go-mode.el | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index e5cdf43..8ee4715 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -571,8 +571,7 @@ buffer."
                     (insert text)))))
              ((equal action "d")
               (with-current-buffer target-buffer
-                (goto-char (point-min))
-                (forward-line (- from line-offset 1))
+                (go--goto-line (- from line-offset))
                 (incf line-offset len)
                 (go--delete-whole-line len)))
              (t
@@ -889,8 +888,7 @@ will be commented, otherwise they will be removed 
completely."
           (message "Cannot operate on unsaved buffer")
         (setq lines (go-unused-imports-lines))
         (dolist (import lines)
-          (goto-char (point-min))
-          (forward-line (1- import))
+          (go--goto-line import)
           (beginning-of-line)
           (if arg
               (comment-region (line-beginning-position) (line-end-position))
@@ -907,8 +905,7 @@ visit FILENAME and go to line LINE and column COLUMN."
           (line (string-to-number (match-string 2 specifier)))
           (column (string-to-number (match-string 3 specifier))))
       (with-current-buffer (funcall (if other-window 'find-file-other-window 
'find-file) filename)
-        (goto-char (point-min))
-        (forward-line (1- line))
+        (go--goto-line line)
         (beginning-of-line)
         (forward-char (1- column))
         (if (buffer-modified-p)
@@ -983,8 +980,7 @@ coverage information gathered via go test 
-coverprofile=INPUT."
 
     (with-temp-buffer
       (insert-file-contents input)
-      (goto-char (point-min))
-      (forward-line) ;; Skip over mode
+      (go--goto-line 2) ;; Skip over mode
       (while (not (eobp))
         (let* ((parts (split-string (buffer-substring (point-at-bol) 
(point-at-eol)) ":"))
                (file (car parts))



reply via email to

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