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

This commit is contained in:
Nathan Sobo 2012-04-04 11:09:55 -06:00
commit 4abf41e173
10 changed files with 10 additions and 25 deletions

View File

@ -88,6 +88,7 @@
isAfterJavaScript:(bool)isAfterJavaScript {
if (isAfterJavaScript && type == KEYEVENT_RAWKEYDOWN && modifiers == KEY_META && code == 'R') {
_clientHandler->GetBrowser()->CloseDevTools();
_clientHandler->GetBrowser()->ReloadIgnoreCache();
return YES;
}

View File

@ -211,7 +211,7 @@ bool ClientHandler::OnConsoleMessage(CefRefPtr<CefBrowser> browser,
{
REQUIRE_UI_THREAD();
std::cout << std::string(message) << "\n\t" << std::string(source) << ":" << line;
std::cout << std::string(message) << "\n";
return true;
}

View File

@ -90,7 +90,7 @@ bool NativeHandler::Execute(const CefString& name,
bool recursive = arguments[1]->GetBoolValue();
NSFileManager *fm = [NSFileManager defaultManager];
NSArray *relativePaths = [NSArray array];
NSArray *relativePaths = nil;
NSError *error = nil;
if (recursive) {
@ -140,7 +140,7 @@ bool NativeHandler::Execute(const CefString& name,
bool recursive = arguments[1]->GetBoolValue();
NSFileManager *fm = [NSFileManager defaultManager];
NSArray *relativePaths = [NSArray array];
NSArray *relativePaths = nil;
NSError *error = nil;
if (recursive) {

View File

@ -7,6 +7,8 @@ describe "Atom", ->
waitsFor "there to be no windows", ->
atom.windows.length == 0
beforeEach ->
spyOn(Atom.prototype, "setUpKeymap")
describe ".open(path)", ->
beforeEach ->
@ -39,9 +41,6 @@ describe "Atom", ->
beforeEach ->
atom = new Atom
afterEach ->
atom.destroy()
it "adds the window to the windows array if it isn't already present", ->
atom.windowOpened window
atom.windowOpened window

View File

@ -677,8 +677,8 @@ describe "Editor", ->
setEditorWidthInChars(editor, 20)
setEditorHeightInChars(editor, 10)
editor.setCursorBufferPosition([11,0])
editor.addCursorAtBufferPosition([0,0])
editor.addCursorAtBufferPosition([6,50])
editor.addCursorAtBufferPosition([0,0])
window.advanceClock()
scrollHandler = spyOn(editor, 'scrollVertically')
@ -701,7 +701,7 @@ describe "Editor", ->
editor.moveCursorRight()
window.advanceClock()
position = editor.pixelPositionForScreenPosition([0,1])
position = editor.pixelPositionForScreenPosition([6,1])
expect(scrollHandler).toHaveBeenCalledWith(position)
describe "auto indent/outdent", ->

View File

@ -13,10 +13,7 @@ beforeEach ->
afterEach ->
$('#jasmine-content').empty()
specsKeymap = new Keymap
specsKeymap.bindDefaultKeys()
$(window).on 'keydown', (e) -> specsKeymap.handleKeyEvent(e)
specsKeymap.bindKeys '*', 'meta-w': 'close'
window.keymap.bindKeys '*', 'meta-w': 'close'
$(document).on 'close', -> window.close()
# Use underscore's definition of equality for toEqual assertions

View File

@ -24,10 +24,6 @@ class Atom
$(document).on 'keydown', @handleKeyEvent
@keymap.bindDefaultKeys()
destroy: ->
$(document).off 'keydown', @handleKeyEvent
@keymap.unbindDefaultKeys()
open: (path) ->
$native.open path

View File

@ -136,5 +136,5 @@ class Cursor extends View
position = @editor.pixelPositionForScreenPosition(screenPosition)
@css(position)
if @editor.getCursors().length == 1 or @editor.screenPositionInBounds(screenPosition)
if this == _.last(@editor.getCursors())
@editor.scrollTo(position)

View File

@ -37,7 +37,6 @@ class Editor extends View
autoIndent: null
lineCache: null
isFocused: false
isScrolling: false
initialize: ({buffer}) ->
requireStylesheet 'editor.css'
@ -482,10 +481,7 @@ class Editor extends View
@buffer.getMode()
scrollTo: (position) ->
return if @isScrolling
@isScrolling = true
_.defer =>
@isScrolling = false
@scrollVertically(position)
@scrollHorizontally(position)

View File

@ -23,10 +23,6 @@ class Keymap
path = $native.openDialog()
atom.open(path) if path
unbindDefaultKeys: ->
$(document).unbind 'new-window', @_newWindow
$(document).unbind 'open', @_open
bindKeys: (selector, bindings) ->
@bindingSets.unshift(new BindingSet(selector, bindings))