Skip to content

Commit e5e2aef

Browse files
Guan Guimarijnh
authored andcommitted
[closebrackets addon] Use editor line separator when exploding lines
Issue codemirror#5031
1 parent c1196eb commit e5e2aef

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

addon/edit/closebrackets.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
8585
}
8686
cm.operation(function() {
87-
cm.replaceSelection("\n\n", null);
87+
var linesep = cm.lineSeparator() || "\n";
88+
cm.replaceSelection(linesep + linesep, null);
8889
cm.execCommand("goCharLeft");
8990
ranges = cm.listSelections();
9091
for (var i = 0; i < ranges.length; i++) {

0 commit comments

Comments
 (0)