From 5a39466285a85077f19f680071546b14e3a545e4 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 4 Apr 2024 14:33:34 -0700 Subject: 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(-) (limited to 'nginx-mode.el') diff --git a/nginx-mode.el b/nginx-mode.el index b01367c..c612719 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. -- cgit v1.2.3-54-g00ecf