Skip to content

Commit

Permalink
[comment-fold addon] Fix bug that broke folding of comments at start …
Browse files Browse the repository at this point in the history
…of line

Closes codemirror#4056
  • Loading branch information
marijnh committed Jun 7, 2016
1 parent eabf5b5 commit 8eb1588
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addon/fold/comment-fold.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ CodeMirror.registerGlobalHelper("fold", "comment", function(mode) {
}
if (pass == 1 && found < start.ch) return;
if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1))) &&
(lineText.slice(found - endToken.length, found) == endToken ||
(found == 0 || lineText.slice(found - endToken.length, found) == endToken ||
!/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found))))) {
startCh = found + startToken.length;
break;
Expand Down

0 comments on commit 8eb1588

Please sign in to comment.