diff --git a/spec/display-buffer-spec.coffee b/spec/display-buffer-spec.coffee index 62875804b..7076d0923 100644 --- a/spec/display-buffer-spec.coffee +++ b/spec/display-buffer-spec.coffee @@ -1038,6 +1038,7 @@ describe "DisplayBuffer", -> displayBuffer.manageScrollPosition = true displayBuffer.setLineHeightInPixels(10) displayBuffer.setDefaultCharWidth(10) + displayBuffer.updateAllScreenLines() it "disallows negative values", -> displayBuffer.setWidth(displayBuffer.getScrollWidth() + 100) @@ -1062,6 +1063,7 @@ describe "DisplayBuffer", -> displayBuffer.setHorizontalScrollbarHeight(0) displayBuffer.setHeight(50) displayBuffer.setWidth(50) + displayBuffer.updateAllScreenLines() it "sets the scroll top and scroll left so the given screen position is in view", -> displayBuffer.scrollToScreenPosition([8, 20]) diff --git a/spec/editor-component-spec.coffee b/spec/editor-component-spec.coffee index f1305774e..9d4bc66d8 100644 --- a/spec/editor-component-spec.coffee +++ b/spec/editor-component-spec.coffee @@ -62,6 +62,7 @@ describe "EditorComponent", -> node.style.height = editor.getLineCount() * lineHeightInPixels + 'px' node.style.width = '1000px' + editor.displayBuffer.updateAllScreenLines() component.measureScrollView() nextTick() diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index 05b84cc79..72baccbca 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -733,6 +733,7 @@ describe "Editor", -> editor.setHorizontalScrollbarHeight(0) editor.setHeight(5.5 * 10) editor.setWidth(5.5 * 10) + editor.displayBuffer.updateAllScreenLines() it "scrolls down when the last cursor gets closer than ::verticalScrollMargin to the bottom of the editor", -> expect(editor.getScrollTop()).toBe 0 @@ -1196,6 +1197,8 @@ describe "Editor", -> editor.setHeight(50) editor.setWidth(50) editor.setHorizontalScrollbarHeight(0) + editor.displayBuffer.updateAllScreenLines() + expect(editor.getScrollTop()).toBe 0 editor.setSelectedBufferRange([[5, 6], [6, 8]], autoscroll: true) @@ -1230,6 +1233,7 @@ describe "Editor", -> editor.setDefaultCharWidth(10) editor.setHeight(50) editor.setWidth(50) + editor.displayBuffer.updateAllScreenLines() editor.addSelectionForBufferRange([[8, 10], [8, 15]]) expect(editor.getScrollTop()).toBe 75