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

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

[nongnu] elpa/go-mode 23310e5 090/495: be more lenient when finding comm


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 23310e5 090/495: be more lenient when finding commented imports
Date: Sat, 7 Aug 2021 09:04:49 -0400 (EDT)

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

    be more lenient when finding commented imports
---
 go-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index 974237b..8bc7316 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -615,7 +615,7 @@ uncommented, otherwise a new import will be added."
         (setq line (format "\"%s\"" import)))
 
       (goto-char (point-min))
-      (if (re-search-forward (concat "^// import " line "$") nil t)
+      (if (re-search-forward (concat "^[[:space:]]*//[[:space:]]*import " line 
"$") nil t)
           (uncomment-region (line-beginning-position) (line-end-position))
         (case (go-goto-imports)
           ('fail (message "Could not find a place to add import."))
@@ -623,7 +623,7 @@ uncommented, otherwise a new import will be added."
               (save-excursion
                 (re-search-backward "^import (")
                 (setq import-start (point)))
-            (if (re-search-backward (concat "^[[:space:]]+// " line "$")  
import-start t)
+            (if (re-search-backward (concat "^[[:space:]]*//[[:space:]]*" line 
"$")  import-start t)
                 (uncomment-region (line-beginning-position) 
(line-end-position))
               (insert "\n\t" line)))
           ('single (insert "import " line "\n"))



reply via email to

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