Merge branch 'master' of github.com:github/atom

This commit is contained in:
Nathan Sobo
2012-03-08 19:32:32 -07:00
3 changed files with 16 additions and 7 deletions

View File

@@ -15,14 +15,19 @@ keymap.bindKeys '*',
$(document).on 'close', -> window.close()
$(document).on 'show-console', -> window.showConsole()
window.profile = (description, fn) ->
window.showConsole()
window.benchmark(description, fn, true)
window.pbenchmark = window.profile
window.fpbenchmark = (description, fn) -> window.profile(description, fn, true)
window.pfbenchmark = window.fpbenchmark
window.fbenchmark = (description, fn, profile) -> window.benchmark(description, fn, profile, true)
window.benchmark = (description, fn, profile=false) ->
it description, ->
window.profile = (description, fn, focused) ->
window.showConsole()
window.benchmark(description, fn, true, focused)
window.benchmark = (description, fn, profile=false, focused=false) ->
method = if focused then fit else it
method description, ->
count = 100
total = measure ->
console.profile(description) if profile

View File

@@ -17,7 +17,7 @@ describe "Editor", ->
editor.insertText('x')
editor.backspace()
fdescribe "when editing a ~300 line CoffeeScript file", ->
describe "when editing a ~300 line CoffeeScript file", ->
beforeEach ->
editor.setBuffer new Buffer(require.resolve('fixtures/medium.coffee'))
@@ -25,3 +25,7 @@ describe "Editor", ->
editor.insertText('x')
editor.backspace()
benchmark "inserting and deleting a character that causes massive token changed", ->
editor.insertText('"')
editor.backspace()

View File

@@ -214,7 +214,7 @@ class Editor extends View
@getLineElement(row).remove()
getLineElement: (row) ->
@lines.find("div.line:eq(#{row})")
$(@lines[0].querySelector("div.line")[row])
toggleSoftWrap: ->
@setSoftWrap(not @softWrap)