We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d8459b commit a8881f2Copy full SHA for a8881f2
src/coding_style/all/f4_lines_number.cr
@@ -35,14 +35,13 @@ class LinesNumber < CodingStyle
35
36
content.scan(FUNCTION_DECLARATION_REGEX).each { |match|
37
row, _ = self.get_row_column(splitted_content, match.end)
38
- indent_level = 0
+ indent_level = 1
39
line_count = 0
40
41
(row...splitted_content.size).each { |i|
42
- if splitted_content[i] =~ /{/
43
- indent_level += 1
44
- elsif splitted_content[i] =~ /}/
45
- indent_level -= 1
+ indent_level += splitted_content[i].count("{")
+ if splitted_content[i] =~ /}/
+ indent_level -= splitted_content[i].count("}")
46
if indent_level <= 0
47
break
48
end
0 commit comments