diff --git a/spec/display-buffer-spec.coffee b/spec/display-buffer-spec.coffee index be89db8ac..140ca2f9e 100644 --- a/spec/display-buffer-spec.coffee +++ b/spec/display-buffer-spec.coffee @@ -44,7 +44,7 @@ describe "DisplayBuffer", -> it "renders line numbers correctly", -> originalLineCount = displayBuffer.getLineCount() oneHundredLines = [0..100].join("\n") - buffer.insert([0,0], oneHundredLines) + buffer.insert([0, 0], oneHundredLines) expect(displayBuffer.getLineCount()).toBe 100 + originalLineCount it "reassigns the scrollTop if it exceeds the max possible value after lines are removed", -> @@ -382,10 +382,10 @@ describe "DisplayBuffer", -> describe "when creating a fold where one already exists", -> it "returns existing fold and does't create new fold", -> - fold = displayBuffer.createFold(0,10) + fold = displayBuffer.createFold(0, 10) expect(displayBuffer.findMarkers(class: 'fold').length).toBe 1 - newFold = displayBuffer.createFold(0,10) + newFold = displayBuffer.createFold(0, 10) expect(newFold).toBe fold expect(displayBuffer.findMarkers(class: 'fold').length).toBe 1 diff --git a/spec/selection-spec.coffee b/spec/selection-spec.coffee index 0e64b60fd..bdccb799d 100644 --- a/spec/selection-spec.coffee +++ b/spec/selection-spec.coffee @@ -14,18 +14,18 @@ describe "Selection", -> describe ".deleteSelectedText()", -> describe "when nothing is selected", -> it "deletes nothing", -> - selection.setBufferRange [[0,3], [0,3]] + selection.setBufferRange [[0, 3], [0, 3]] selection.deleteSelectedText() expect(buffer.lineForRow(0)).toBe "var quicksort = function () {" describe "when one line is selected", -> it "deletes selected text and clears the selection", -> - selection.setBufferRange [[0,4], [0,14]] + selection.setBufferRange [[0, 4], [0, 14]] selection.deleteSelectedText() expect(buffer.lineForRow(0)).toBe "var = function () {" endOfLine = buffer.lineForRow(0).length - selection.setBufferRange [[0,0], [0, endOfLine]] + selection.setBufferRange [[0, 0], [0, endOfLine]] selection.deleteSelectedText() expect(buffer.lineForRow(0)).toBe "" @@ -33,15 +33,15 @@ describe "Selection", -> describe "when multiple lines are selected", -> it "deletes selected text and clears the selection", -> - selection.setBufferRange [[0,1], [2,39]] + selection.setBufferRange [[0, 1], [2, 39]] selection.deleteSelectedText() expect(buffer.lineForRow(0)).toBe "v;" expect(selection.isEmpty()).toBeTruthy() describe "when the cursor precedes the tail", -> it "deletes selected text and clears the selection", -> - selection.cursor.setScreenPosition [0,13] - selection.selectToScreenPosition [0,4] + selection.cursor.setScreenPosition [0, 13] + selection.selectToScreenPosition [0, 4] selection.delete() expect(buffer.lineForRow(0)).toBe "var = function () {" diff --git a/spec/text-editor-element-spec.coffee b/spec/text-editor-element-spec.coffee index 435b3a4a5..ea5f55968 100644 --- a/spec/text-editor-element-spec.coffee +++ b/spec/text-editor-element-spec.coffee @@ -83,7 +83,7 @@ describe "TextEditorElement", -> editor = new TextEditor editor.setText('1\n2\n3') editor.addGutter({name: 'test-gutter'}) - marker = editor.markBufferRange([[0,0],[2,0]]) + marker = editor.markBufferRange([[0, 0], [2, 0]]) editor.decorateMarker(marker, {type: 'gutter', gutterName: 'test-gutter'}) element = atom.views.getView(editor) diff --git a/spec/tokenized-buffer-spec.coffee b/spec/tokenized-buffer-spec.coffee index 45cc03a44..9d94cb80a 100644 --- a/spec/tokenized-buffer-spec.coffee +++ b/spec/tokenized-buffer-spec.coffee @@ -287,7 +287,7 @@ describe "TokenizedBuffer", -> describe "when there is an insertion that is larger than the chunk size", -> it "tokenizes the initial chunk synchronously, then tokenizes the remaining lines in the background", -> commentBlock = _.multiplyString("// a comment\n", tokenizedBuffer.chunkSize + 2) - buffer.insert([0,0], commentBlock) + buffer.insert([0, 0], commentBlock) expect(tokenizedBuffer.tokenizedLineForRow(0).ruleStack?).toBeTruthy() expect(tokenizedBuffer.tokenizedLineForRow(4).ruleStack?).toBeTruthy() expect(tokenizedBuffer.tokenizedLineForRow(5).ruleStack?).toBeFalsy() @@ -541,7 +541,7 @@ describe "TokenizedBuffer", -> runs -> fullyTokenize(tokenizedBuffer) {tokens} = tokenizedBuffer.tokenizedLineForRow(0) - expect(tokens[0]).toEqual value: '<', scopes: ["text.html.ruby","meta.tag.block.any.html","punctuation.definition.tag.begin.html"] + expect(tokens[0]).toEqual value: '<', scopes: ["text.html.ruby", "meta.tag.block.any.html", "punctuation.definition.tag.begin.html"] describe ".tokenForPosition(position)", -> afterEach -> @@ -552,9 +552,9 @@ describe "TokenizedBuffer", -> buffer = atom.project.bufferForPathSync('sample.js') tokenizedBuffer = new TokenizedBuffer({buffer}) fullyTokenize(tokenizedBuffer) - expect(tokenizedBuffer.tokenForPosition([1,0]).scopes).toEqual ["source.js"] - expect(tokenizedBuffer.tokenForPosition([1,1]).scopes).toEqual ["source.js"] - expect(tokenizedBuffer.tokenForPosition([1,2]).scopes).toEqual ["source.js", "storage.modifier.js"] + expect(tokenizedBuffer.tokenForPosition([1, 0]).scopes).toEqual ["source.js"] + expect(tokenizedBuffer.tokenForPosition([1, 1]).scopes).toEqual ["source.js"] + expect(tokenizedBuffer.tokenForPosition([1, 2]).scopes).toEqual ["source.js", "storage.modifier.js"] describe ".bufferRangeForScopeAtPosition(selector, position)", -> beforeEach -> @@ -580,20 +580,20 @@ describe "TokenizedBuffer", -> buffer.setText('\ttest') tokenizedBuffer = new TokenizedBuffer({buffer}) fullyTokenize(tokenizedBuffer) - expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' ' + expect(tokenizedBuffer.tokenForPosition([0, 0]).value).toBe ' ' atom.config.set('editor.tabLength', 6) - expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' ' + expect(tokenizedBuffer.tokenForPosition([0, 0]).value).toBe ' ' it "does not allow the tab length to be less than 1", -> buffer = atom.project.bufferForPathSync('sample.js') buffer.setText('\ttest') tokenizedBuffer = new TokenizedBuffer({buffer}) fullyTokenize(tokenizedBuffer) - expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' ' + expect(tokenizedBuffer.tokenForPosition([0, 0]).value).toBe ' ' atom.config.set('editor.tabLength', 1) - expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' ' + expect(tokenizedBuffer.tokenForPosition([0, 0]).value).toBe ' ' atom.config.set('editor.tabLength', 0) - expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' ' + expect(tokenizedBuffer.tokenForPosition([0, 0]).value).toBe ' ' describe "when the invisibles value changes", -> beforeEach -> diff --git a/spec/workspace-spec.coffee b/spec/workspace-spec.coffee index 0b32ff31f..009f95a1c 100644 --- a/spec/workspace-spec.coffee +++ b/spec/workspace-spec.coffee @@ -1027,7 +1027,7 @@ describe "Workspace", -> atom.project.open('sample.js').then (o) -> editor = o runs -> - editor.buffer.setTextInRange([[0,0],[0,0]], 'omg') + editor.buffer.setTextInRange([[0, 0], [0, 0]], 'omg') expect(editor.isModified()).toBeTruthy() waitsForPromise -> diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index d81660a49..1b2aa2e86 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -174,7 +174,7 @@ class AtomApplication @on 'application:open-safe', -> @promptForPathToOpen('all', safeMode: true) @on 'application:open-api-preview', -> @promptForPathToOpen('all', apiPreviewMode: true) @on 'application:open-dev-api-preview', -> @promptForPathToOpen('all', {apiPreviewMode: true, devMode: true}) - @on 'application:inspect', ({x,y, atomWindow}) -> + @on 'application:inspect', ({x, y, atomWindow}) -> atomWindow ?= @focusedWindow() atomWindow?.browserWindow.inspectElement(x, y) diff --git a/src/cursor.coffee b/src/cursor.coffee index b54cc6bcd..0681e51ca 100644 --- a/src/cursor.coffee +++ b/src/cursor.coffee @@ -333,7 +333,7 @@ class Cursor extends Model # Public: Moves the cursor to the top of the buffer. moveToTop: -> - @setBufferPosition([0,0]) + @setBufferPosition([0, 0]) # Public: Moves the cursor to the bottom of the buffer. moveToBottom: -> @@ -673,9 +673,9 @@ class Cursor extends Model start = @getBufferPosition() {row, column} = start - scanRange = [[row-1, column], [0,0]] + scanRange = [[row-1, column], [0, 0]] position = new Point(0, 0) - zero = new Point(0,0) + zero = new Point(0, 0) @editor.backwardsScanInBufferRange /^\n*$/g, scanRange, ({range, stop}) -> unless range.start.isEqual(zero) position = range.start