Use correct indentation

This commit is contained in:
Kevin Sawicki
2013-05-29 11:55:06 -07:00
parent e19c0e4f87
commit ce71cf7703
4 changed files with 34 additions and 34 deletions

View File

@@ -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", ->

View File

@@ -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", ->

View File

@@ -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", ->

View File

@@ -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