diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index c36811c93..db377882b 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -1039,10 +1039,12 @@ describe "Editor", -> describe "when the text exceeds the editor width and the scroll-view is horizontally scrolled", -> it "wraps the text and renders properly", -> editor.attachToDom(heightInLines: 30, widthInChars: 30) + editor.setWidthInChars(100) editor.setText("Fashion axe umami jean shorts retro hashtag carles mumblecore. Photo booth skateboard Austin gentrify occupy ethical. Food truck gastropub keffiyeh, squid deep v pinterest literally sustainable salvia scenester messenger bag. Neutra messenger bag flexitarian four loko, shoreditch VHS pop-up tumblr seitan synth master cleanse. Marfa selvage ugh, raw denim authentic try-hard mcsweeney's trust fund fashion axe actually polaroid viral sriracha. Banh mi marfa plaid single-origin coffee. Pickled mumblecore lomo ugh bespoke.") editor.scrollLeft(editor.charWidth * 30) editor.trigger "editor:toggle-soft-wrap" expect(editor.scrollLeft()).toBe 0 + expect(editor.activeEditSession.getSoftWrapColumn()).not.toBe 100 describe "text rendering", -> describe "when all lines in the buffer are visible on screen", -> diff --git a/src/editor.coffee b/src/editor.coffee index 3f475b785..6f5a505ee 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -929,6 +929,7 @@ class Editor extends View # Toggle soft wrap on the edit session. toggleSoftWrap: -> + @setWidthInChars() @activeEditSession.setSoftWrap(not @activeEditSession.getSoftWrap()) calculateWidthInChars: ->