mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Merge branch 'master' of github.com:github/atom
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user