From ce71cf770300750bd5f7bae47b9a2cf843084aca Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 29 May 2013 11:55:06 -0700 Subject: [PATCH] Use correct indentation --- spec/app/edit-session-spec.coffee | 28 ++++++++++++------------ spec/app/keymap-spec.coffee | 30 +++++++++++++------------- spec/app/text-mate-grammar-spec.coffee | 4 ++-- src/atom-application.coffee | 6 +++--- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/spec/app/edit-session-spec.coffee b/spec/app/edit-session-spec.coffee index f2213e044..56f4e77c4 100644 --- a/spec/app/edit-session-spec.coffee +++ b/spec/app/edit-session-spec.coffee @@ -602,14 +602,14 @@ describe "EditSession", -> describe ".selectLine()", -> it "selects the entire line (including newlines) at given row", -> - editSession.setCursorScreenPosition([1, 2]) - editSession.selectLine() - expect(editSession.getSelectedBufferRange()).toEqual [[1,0], [2,0]] - expect(editSession.getSelectedText()).toBe " var sort = function(items) {\n" + editSession.setCursorScreenPosition([1, 2]) + editSession.selectLine() + expect(editSession.getSelectedBufferRange()).toEqual [[1,0], [2,0]] + expect(editSession.getSelectedText()).toBe " var sort = function(items) {\n" - editSession.setCursorScreenPosition([12, 2]) - editSession.selectLine() - expect(editSession.getSelectedBufferRange()).toEqual [[12,0], [12,2]] + editSession.setCursorScreenPosition([12, 2]) + editSession.selectLine() + expect(editSession.getSelectedBufferRange()).toEqual [[12,0], [12,2]] describe ".selectToBeginningOfWord()", -> it "selects text from cusor position to beginning of word", -> @@ -1637,13 +1637,13 @@ describe "EditSession", -> expect(buffer.lineForRow(11)).toBe " return sort(Array.apply(this, arguments));" expect(editSession.getSelectedBufferRange()).toEqual [[9, 1 + editSession.getTabLength()], [11, 15 + editSession.getTabLength()]] - it "does not indent the last row if the selection ends at column 0", -> - editSession.setSelectedBufferRange([[9,1], [11,0]]) - editSession.indentSelectedRows() - expect(buffer.lineForRow(9)).toBe " };" - expect(buffer.lineForRow(10)).toBe "" - expect(buffer.lineForRow(11)).toBe " return sort(Array.apply(this, arguments));" - expect(editSession.getSelectedBufferRange()).toEqual [[9, 1 + editSession.getTabLength()], [11, 0]] + it "does not indent the last row if the selection ends at column 0", -> + editSession.setSelectedBufferRange([[9,1], [11,0]]) + editSession.indentSelectedRows() + expect(buffer.lineForRow(9)).toBe " };" + expect(buffer.lineForRow(10)).toBe "" + expect(buffer.lineForRow(11)).toBe " return sort(Array.apply(this, arguments));" + expect(editSession.getSelectedBufferRange()).toEqual [[9, 1 + editSession.getTabLength()], [11, 0]] describe "when softTabs is disabled", -> it "indents selected lines (that are not empty) and retains selection", -> diff --git a/spec/app/keymap-spec.coffee b/spec/app/keymap-spec.coffee index d38200dd9..63cd27a3a 100644 --- a/spec/app/keymap-spec.coffee +++ b/spec/app/keymap-spec.coffee @@ -216,23 +216,23 @@ describe "Keymap", -> describe "when the event's target node descends from multiple nodes that match selectors with a partial binding match", -> it "allows any of the bindings to be triggered upon a second keystroke, favoring the most specific selector", -> - keymap.bindKeys ".grandchild-node", 'ctrl-x ctrl-c': 'more-specific-quit' - grandchildNode = fragment.find('.grandchild-node')[0] - moreSpecificQuitHandler = jasmine.createSpy('moreSpecificQuitHandler') - fragment.on 'more-specific-quit', moreSpecificQuitHandler + keymap.bindKeys ".grandchild-node", 'ctrl-x ctrl-c': 'more-specific-quit' + grandchildNode = fragment.find('.grandchild-node')[0] + moreSpecificQuitHandler = jasmine.createSpy('moreSpecificQuitHandler') + fragment.on 'more-specific-quit', moreSpecificQuitHandler - expect(keymap.handleKeyEvent(keydownEvent('x', target: grandchildNode, ctrlKey: true))).toBeFalsy() - expect(keymap.handleKeyEvent(keydownEvent('1', target: grandchildNode))).toBeFalsy() - expect(quitHandler).not.toHaveBeenCalled() - expect(moreSpecificQuitHandler).not.toHaveBeenCalled() - expect(closeOtherWindowsHandler).toHaveBeenCalled() - closeOtherWindowsHandler.reset() + expect(keymap.handleKeyEvent(keydownEvent('x', target: grandchildNode, ctrlKey: true))).toBeFalsy() + expect(keymap.handleKeyEvent(keydownEvent('1', target: grandchildNode))).toBeFalsy() + expect(quitHandler).not.toHaveBeenCalled() + expect(moreSpecificQuitHandler).not.toHaveBeenCalled() + expect(closeOtherWindowsHandler).toHaveBeenCalled() + closeOtherWindowsHandler.reset() - expect(keymap.handleKeyEvent(keydownEvent('x', target: grandchildNode, ctrlKey: true))).toBeFalsy() - expect(keymap.handleKeyEvent(keydownEvent('c', target: grandchildNode, ctrlKey: true))).toBeFalsy() - expect(quitHandler).not.toHaveBeenCalled() - expect(closeOtherWindowsHandler).not.toHaveBeenCalled() - expect(moreSpecificQuitHandler).toHaveBeenCalled() + expect(keymap.handleKeyEvent(keydownEvent('x', target: grandchildNode, ctrlKey: true))).toBeFalsy() + expect(keymap.handleKeyEvent(keydownEvent('c', target: grandchildNode, ctrlKey: true))).toBeFalsy() + expect(quitHandler).not.toHaveBeenCalled() + expect(closeOtherWindowsHandler).not.toHaveBeenCalled() + expect(moreSpecificQuitHandler).toHaveBeenCalled() describe "when there is a complete binding with a less specific selector", -> it "favors the more specific partial match", -> diff --git a/spec/app/text-mate-grammar-spec.coffee b/spec/app/text-mate-grammar-spec.coffee index c3e1efd80..c0deff48b 100644 --- a/spec/app/text-mate-grammar-spec.coffee +++ b/spec/app/text-mate-grammar-spec.coffee @@ -122,8 +122,8 @@ describe "TextMateGrammar", -> describe "when the line is empty", -> it "returns a single token which has the global scope", -> - {tokens} = grammar.tokenizeLine('') - expect(tokens[0]).toEqual value: '', scopes: ["source.coffee"] + {tokens} = grammar.tokenizeLine('') + expect(tokens[0]).toEqual value: '', scopes: ["source.coffee"] describe "when the line matches no patterns", -> it "does not infinitely loop", -> diff --git a/src/atom-application.coffee b/src/atom-application.coffee index 79c195ca2..fdc3ec4a0 100644 --- a/src/atom-application.coffee +++ b/src/atom-application.coffee @@ -28,7 +28,7 @@ class AtomApplication constructor: ({@resourcePath, @executedFrom, @pathsToOpen, @testMode, @version}) -> if @pathsToOpen? @pathsToOpen = @pathsToOpen.map (pathToOpen) => - path.resolve(@executedFrom, pathToOpen) + path.resolve(@executedFrom, pathToOpen) else @pathsToOpen = [@executedFrom] if @executedFrom @@ -204,8 +204,8 @@ class AtomApplication resourcePath: @resourcePath else atomWindow = new AtomWindow - bootstrapScript: 'window-bootstrap' - resourcePath: @resourcePath + bootstrapScript: 'window-bootstrap' + resourcePath: @resourcePath openConfig: -> if @configWindow