diff --git a/Atom/src/AtomController.mm b/Atom/src/AtomController.mm index 880ecd06d..a4c515b82 100644 --- a/Atom/src/AtomController.mm +++ b/Atom/src/AtomController.mm @@ -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; } diff --git a/Atom/src/client_handler.mm b/Atom/src/client_handler.mm index b0046f985..203fe0fd5 100755 --- a/Atom/src/client_handler.mm +++ b/Atom/src/client_handler.mm @@ -211,7 +211,7 @@ bool ClientHandler::OnConsoleMessage(CefRefPtr browser, { REQUIRE_UI_THREAD(); - std::cout << std::string(message) << "\n\t" << std::string(source) << ":" << line; + std::cout << std::string(message) << "\n"; return true; } diff --git a/Atom/src/native_handler.mm b/Atom/src/native_handler.mm index cdf9d86f2..3b9fe605c 100644 --- a/Atom/src/native_handler.mm +++ b/Atom/src/native_handler.mm @@ -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) { diff --git a/spec/app/atom-spec.coffee b/spec/app/atom-spec.coffee index 57b761cec..3949863c3 100644 --- a/spec/app/atom-spec.coffee +++ b/spec/app/atom-spec.coffee @@ -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 diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index ffbebd862..c3496b671 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -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", -> diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 71940d5f6..1ec1e852f 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -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 diff --git a/src/app/atom.coffee b/src/app/atom.coffee index 846376994..8f3187857 100644 --- a/src/app/atom.coffee +++ b/src/app/atom.coffee @@ -24,10 +24,6 @@ class Atom $(document).on 'keydown', @handleKeyEvent @keymap.bindDefaultKeys() - destroy: -> - $(document).off 'keydown', @handleKeyEvent - @keymap.unbindDefaultKeys() - open: (path) -> $native.open path diff --git a/src/app/cursor.coffee b/src/app/cursor.coffee index df0353841..6f61da400 100644 --- a/src/app/cursor.coffee +++ b/src/app/cursor.coffee @@ -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) diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 107e8cf5c..06cf83612 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -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) diff --git a/src/app/keymap.coffee b/src/app/keymap.coffee index 07459f45b..9d02c540d 100644 --- a/src/app/keymap.coffee +++ b/src/app/keymap.coffee @@ -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))