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

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

[nongnu] elpa/go-mode db41787 015/495: if line has been indented with sp


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode db41787 015/495: if line has been indented with spaces, replace them with tabs
Date: Sat, 7 Aug 2021 09:04:34 -0400 (EDT)

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

    if line has been indented with spaces, replace them with tabs
---
 go-mode.el | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index ee7eabf..6770ec0 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -184,7 +184,6 @@ built-ins, functions, and some types.")
 (defun go-mode-indent-line ()
   (interactive)
   (let ((indent (go-indentation-at-point (point)))
-        shift-amt
         end
         (pos (- (point-max) (point)))
         (beg (progn (beginning-of-line) (point))))
@@ -197,10 +196,8 @@ built-ins, functions, and some types.")
         (setq indent 0))
     (skip-chars-forward " \t")
     (setq shift-amt (- indent (current-column)))
-    (if (zerop shift-amt)
-        nil
-      (delete-region beg (point))
-      (indent-to indent))
+    (delete-region beg (point))
+    (indent-to indent)
     ;; If initial point was within line's indentation,
     ;; position after the indentation.  Else stay at same point in text.
     (if (> (- (point-max) pos) (point))



reply via email to

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