1
0
Fork 1

If block contains zero newlines, it's not a block

(cherry picked from commit ab52dddfce133daf4b9cb132c8cd2f829de0c1fb)
This commit is contained in:
Stephen Paul Weber 2024-09-18 13:56:18 -05:00 committed by Arne
parent d32bcc6c61
commit eeab4e6d46

View file

@ -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;
}
}