Merge pull request #913 from nature-of-code/fix/pair-max-lines

[Fix] Check if maxLines is `undefined`
This commit is contained in:
Yifei Gao 2024-03-12 16:56:27 +08:00 committed by GitHub
commit c1379b8ab2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,7 +51,7 @@ Plugin.prototype = {
(this.isComment(line) && pair.code.length > 0) ||
(!pair.maxLines && currentIndent < pair.indent) ||
(!pair.maxLines && line === '' && pair.comment.length > 0) ||
(!!pair.maxLines && pair.code.length >= pair.maxLines)
(pair.maxLines !== undefined && pair.code.length >= pair.maxLines)
) {
if (pair.code.length > 0 || pair.comment.length > 0) {
pairs.push(pair);