You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/search_test.js
+18
Original file line number
Diff line number
Diff line change
@@ -679,6 +679,24 @@ module.exports = {
679
679
assert.position(ranges[7].end,15,0);
680
680
},
681
681
682
+
"test: find line breaks backwards using regex" : function(){
683
+
varsession=newEditSession('\nfunction foo(items, nada) {\n for (var i=0; i<items.length; i++) {\n alert(items[i] + "juhu\\n");\n }\t/* Real Tab */\n\n\n\n\n}\n\n\n// test search/replace line break with regexp\r\n\r\n\t\t\t\t\n');
684
+
session.getSelection().moveCursorTo(2,5);
685
+
686
+
varsearch=newSearch().set({
687
+
needle: "\\n",
688
+
regExp: true,
689
+
wrap: true,
690
+
backwards: true
691
+
});
692
+
693
+
varrange=search.find(session);
694
+
695
+
// Should find the first newline to the left of the cursor
696
+
assert.position(range.start,1,27);
697
+
assert.position(range.end,2,0);
698
+
},
699
+
682
700
"test: replace with line breaks (\\n) and TAB (\\t) using regular expression" : function(){
0 commit comments