8000 Fix indents in macros · jeremyevans/ruby@7a735c4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7a735c4

Browse files
committed
Fix indents in macros
1 parent 68d6cc6 commit 7a735c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tool/auto-style.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ def with_clean_env
237237

238238
if File.fnmatch?("*.[ch]", f, File::FNM_PATHNAME) &&
239239
!DIFFERENT_STYLE_FILES.any? {|pat| File.fnmatch?(pat, f, File::FNM_PATHNAME)}
240-
indent0 = true if src.gsub!(/^\w+\([^(\n)]*?\)\K[ \t]*(?=\{$)/, "\n")
241-
indent0 = true if src.gsub!(/^([ \t]*)\}\K[ \t]*(?=else\b)/, "\n" '\1')
240+
indent0 = true if src.gsub!(/^\w+\([^\n]*?\)\K[ \t]*(?=\{( *\\)?$)/, '\1' "\n")
241+
indent0 = true if src.gsub!(/^([ \t]*)\}\K[ \t]*(?=else\b.*?( *\\)?$)/, '\2' "\n" '\1')
242242
indent0 = true if src.gsub!(/^[ \t]*\}\n\K\n+(?=[ \t]*else\b)/, '')
243243
indent ||= indent0
244244
end

0 commit comments

Comments
 (0)
0