[continuecomment addon] Continue comments when a newline is inserted before them
Fix issue where lastIndexOff was accidentally passed a negative start position, which causes it to search from the end of the string. Closes #6065
This commit is contained in:
parent
74de67598c
commit
0f191d54ee
|
@ -32,7 +32,8 @@
|
|||
lineCmt && (found = line.lastIndexOf(lineCmt, pos.ch - 1)) > -1 &&
|
||||
/\bcomment\b/.test(cm.getTokenTypeAt({line: pos.line, ch: found + 1}))) {
|
||||
// ...then don't continue it
|
||||
} else if ((found = line.lastIndexOf(blockStart, pos.ch - blockStart.length)) > -1 &&
|
||||
} else if (pos.ch >= blockStart.length &&
|
||||
(found = line.lastIndexOf(blockStart, pos.ch - blockStart.length)) > -1 &&
|
||||
found > end) {
|
||||
// reuse the existing leading spaces/tabs/mixed
|
||||
// or build the correct indent using CM's tab/indent options
|
||||
|
|
Loading…
Reference in New Issue