Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
when reseting text in editor, ignore line-ending differences
Browse files Browse the repository at this point in the history
  • Loading branch information
zaggino committed Nov 1, 2016
1 parent c77d4f8 commit 357b0cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,11 @@ define(function (require, exports, module) {
*/
Editor.prototype._resetText = function (text) {
var currentText = this._codeMirror.getValue();
if (text === currentText) {

// compare with ignoring line-endings, issue #11826
var textLF = text ? text.replace(/(\r\n|\r|\n)/g, "\n") : null;
var currentTextLF = currentText ? currentText.replace(/(\r\n|\r|\n)/g, "\n") : null;
if (textLF === currentTextLF) {
// there's nothing to reset
return;
}
Expand Down

0 comments on commit 357b0cf

Please sign in to comment.