Skip to content

Commit

Permalink
Merge pull request #913 from nature-of-code/fix/pair-max-lines
Browse files Browse the repository at this point in the history
[Fix] Check if maxLines is `undefined`
  • Loading branch information
jasongao97 authored Mar 12, 2024
2 parents be4c84f + deab9e9 commit c1379b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion magicbook/plugins/codesplit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c1379b8

Please sign in to comment.