If block contains zero newlines, it's not a block
(cherry picked from commit ab52dddfce133daf4b9cb132c8cd2f829de0c1fb)
This commit is contained in:
parent
d32bcc6c61
commit
eeab4e6d46
1 changed files with 3 additions and 1 deletions
|
@ -120,9 +120,11 @@ public class ImStyleParser {
|
|||
}
|
||||
|
||||
private static int seekEndBlock(CharSequence text, char needle, int start, int end) {
|
||||
var foundNewline = false;
|
||||
for (int i = start; i <= end; ++i) {
|
||||
char c = text.charAt(i);
|
||||
if (c == needle && isCharRepeatedTwoTimes(text, needle, i + 1, end)) {
|
||||
if (c == '\n') foundNewline = true;
|
||||
if (foundNewline && c == needle && isCharRepeatedTwoTimes(text, needle, i + 1, end)) {
|
||||
return i + 2;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue