Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1353)

Unified Diff: third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js

Issue 2615633012: DevTools: Let CodeMirror handle line endings (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
diff --git a/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js b/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
index 0310ab642ec1be3737dfcf21d0a85613efa68e33..6cdba4c5769f4ef81bb78283c4513b80ce89d7cd 100644
--- a/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
+++ b/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
@@ -1189,9 +1189,9 @@ TextEditor.CodeMirrorTextEditor = class extends UI.VBox {
*/
text(textRange) {
if (!textRange)
- return this._codeMirror.getValue().replace(/\n/g, this._lineSeparator);
+ return this._codeMirror.getValue(this._lineSeparator);
var pos = TextEditor.CodeMirrorUtils.toPos(textRange.normalize());
- return this._codeMirror.getRange(pos.start, pos.end).replace(/\n/g, this._lineSeparator);
+ return this._codeMirror.getRange(pos.start, pos.end, this._lineSeparator);
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698