mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
@@ -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", ->
|
||||
|
||||
@@ -929,6 +929,7 @@ class Editor extends View
|
||||
|
||||
# Toggle soft wrap on the edit session.
|
||||
toggleSoftWrap: ->
|
||||
@setWidthInChars()
|
||||
@activeEditSession.setSoftWrap(not @activeEditSession.getSoftWrap())
|
||||
|
||||
calculateWidthInChars: ->
|
||||
|
||||
Reference in New Issue
Block a user