diff --git a/benchmark/benchmark-helper.coffee b/benchmark/benchmark-helper.coffee index 49b82d2ed..dff4cee35 100644 --- a/benchmark/benchmark-helper.coffee +++ b/benchmark/benchmark-helper.coffee @@ -10,7 +10,7 @@ require 'window' requireStylesheet "jasmine.css" # Load TextMate bundles, which specs rely on (but not other packages) -atom.loadPackages(atom.getAvailableTextMateBundles()) +atom.loadTextMatePackages() beforeEach -> # reset config after each benchmark; don't load or save from/to `config.json` diff --git a/benchmark/benchmark-suite.coffee b/benchmark/benchmark-suite.coffee index 1f784071b..41e437f9b 100644 --- a/benchmark/benchmark-suite.coffee +++ b/benchmark/benchmark-suite.coffee @@ -17,9 +17,15 @@ describe "editor.", -> editor = rootView.getActiveEditor() afterEach -> - $(window).off 'beforeunload' - window.shutdown() - atom.setRootViewStateForPath(rootView.project.getPath(), null) + if editor.pendingDisplayUpdate + waitsFor "editor to finish rendering", (done) -> + editor.on 'editor:display-updated', done + + runs -> + projectPath = rootView.project.getPath() + $(window).off 'beforeunload' + window.shutdown() + atom.setRootViewStateForPath(projectPath, null) describe "keymap.", -> event = null diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 987130f0e..4df9c4dd8 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -882,6 +882,7 @@ class Editor extends View @updateCursorViews() @updateSelectionViews() @autoscroll(options) + @trigger 'editor:display-updated' updateCursorViews: -> if @newCursors.length > 0