branch: elpa/nginx-mode
commit 5a39466285a85077f19f680071546b14e3a545e4
Author: Tom Willemse <[email protected]>
Commit: Tom Willemse <[email protected]>
Allow anything to follow a closing brace at start of line
Specifically this fixes an indentation issue with this:
if ($host = example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
Before this change this would have been indented as:
if ($host = example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
Because the regular expression was looking for a ‘}’ with nothing following
it,
but comments can follow this construct just fine.
---
nginx-mode.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nginx-mode.el b/nginx-mode.el
index b01367c596..c6127198f7 100644
--- a/nginx-mode.el
+++ b/nginx-mode.el
@@ -112,7 +112,7 @@ of the closing brace of a block."
(block-indent (nginx-block-indent))
cur-indent)
(cond
- ((and (looking-at "^\\s-*}\\s-*$") block-indent)
+ ((and (looking-at "^\\s-*}") block-indent)
;; This line contains a closing brace and we're at the inner
;; block, so we should indent it matching the indentation of
;; the opening brace of the block.