diff --git a/src/app.js b/src/app.js index 68617e45370..9753d557932 100644 --- a/src/app.js +++ b/src/app.js @@ -487,7 +487,7 @@ var run = function () { // ----------------- editor resize --------------- function onResize () { - editor.resize() + editor.resize(document.querySelector('#editorWrap').checked) reAdjust() } window.onresize = onResize diff --git a/src/app/editor.js b/src/app/editor.js index ee500b60b4d..bbb2b8b662d 100644 --- a/src/app/editor.js +++ b/src/app/editor.js @@ -95,10 +95,10 @@ function Editor () { } } - this.resize = function () { + this.resize = function (useWrapMode) { editor.resize() var session = editor.getSession() - session.setUseWrapMode(document.querySelector('#editorWrap').checked) + session.setUseWrapMode(useWrapMode) if (session.getUseWrapMode()) { var characterWidth = editor.renderer.characterWidth var contentWidth = editor.container.ownerDocument.getElementsByClassName('ace_scroller')[0].clientWidth