branch: elpa/web-mode
commit f8824054d6256dbe73beaf84f4a6aeb5bc0c9f72
Merge: 4833df593e b0606702fe
Author: fxbois <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #1244 from
ncaq/fix-space-padding-of-web-mode-comment-indent-new-line
fixed: web-mode-comment-indent-new-line
---
web-mode.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/web-mode.el b/web-mode.el
index 7f0b07109e..d5667bca62 100644
--- a/web-mode.el
+++ b/web-mode.el
@@ -11034,7 +11034,14 @@ Prompt user if TAG-NAME isn't provided."
(t
(newline 1)
(indent-line-to (plist-get ctx :col))
- (insert (concat (plist-get ctx :prefix) "")))
+ (let ((prefix (plist-get ctx :prefix)))
+ (insert
+ (concat prefix
+ ;; Check if the comment ends with a space, and if not, insert
one.
+ (if
+ (string-equal (substring prefix -1 (length prefix)) " ")
+ ""
+ " ")))))
) ;cond
))