From 32e59ce23847204a8a3ac4997b4a49a6afe82b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Sch=C3=BC=C3=9Fler?= Date: Wed, 30 Jul 2014 19:28:08 +0200 Subject: [PATCH 1/2] Cleanup code according to coffeelint --- benchmark/benchmark-helper.coffee | 2 +- spec/atom-reporter.coffee | 6 +- spec/context-menu-manager-spec.coffee | 2 +- spec/deserializer-manager-spec.coffee | 2 +- spec/editor-view-spec.coffee | 4 +- spec/pane-spec.coffee | 2 +- spec/pane-view-spec.coffee | 2 +- spec/spec-helper.coffee | 2 +- spec/time-reporter.coffee | 2 +- spec/window-spec.coffee | 4 +- src/command-installer.coffee | 2 +- src/config.coffee | 2 +- src/cursor.coffee | 18 +-- src/display-buffer.coffee | 2 +- src/editor-component.coffee | 190 +++++++++++++------------- src/editor-view.coffee | 6 +- src/editor.coffee | 50 +++---- src/gutter-view.coffee | 12 +- src/package.coffee | 2 +- src/react-editor-view.coffee | 12 +- src/scoped-properties.coffee | 2 +- src/select-list-view.coffee | 4 +- src/selection.coffee | 2 +- src/task-bootstrap.coffee | 12 +- src/tokenized-buffer.coffee | 2 +- 25 files changed, 173 insertions(+), 173 deletions(-) diff --git a/benchmark/benchmark-helper.coffee b/benchmark/benchmark-helper.coffee index 312d2258d..a73c24e71 100644 --- a/benchmark/benchmark-helper.coffee +++ b/benchmark/benchmark-helper.coffee @@ -101,7 +101,7 @@ $.fn.resultOfTrigger = (type) -> event.result $.fn.enableKeymap = -> - @on 'keydown', (e) => window.keymap.handleKeyEvent(e) + @on 'keydown', (e) -> window.keymap.handleKeyEvent(e) $.fn.attachToDom = -> $('#jasmine-content').append(this) diff --git a/spec/atom-reporter.coffee b/spec/atom-reporter.coffee index 0497f35a3..6d9940ec4 100644 --- a/spec/atom-reporter.coffee +++ b/spec/atom-reporter.coffee @@ -84,7 +84,7 @@ class AtomReporter extends View else @message.text "#{@failedCount} failures" - reportSuiteResults: (suite) -> + reportSuiteResults: (suite) -> return reportSpecResults: (spec) -> @completeSpecCount++ @@ -119,14 +119,14 @@ class AtomReporter extends View grim.clearDeprecations() handleEvents: -> - $(document).on "click", ".spec-toggle", ({currentTarget}) => + $(document).on "click", ".spec-toggle", ({currentTarget}) -> element = $(currentTarget) specFailures = element.parent().find('.spec-failures') specFailures.toggle() element.toggleClass('folded') false - $(document).on "click", ".deprecation-toggle", ({currentTarget}) => + $(document).on "click", ".deprecation-toggle", ({currentTarget}) -> element = $(currentTarget) deprecationList = $(document).find('.deprecation-list') deprecationList.toggle() diff --git a/spec/context-menu-manager-spec.coffee b/spec/context-menu-manager-spec.coffee index 4ec1c5b8d..152944b61 100644 --- a/spec/context-menu-manager-spec.coffee +++ b/spec/context-menu-manager-spec.coffee @@ -161,7 +161,7 @@ describe "ContextMenuManager", -> describe "executeBuildHandlers", -> menuTemplate = [ label: 'label' - executeAtBuild: -> + executeAtBuild: -> return ] event = target: null diff --git a/spec/deserializer-manager-spec.coffee b/spec/deserializer-manager-spec.coffee index 3a2bf95e4..6c9761ef0 100644 --- a/spec/deserializer-manager-spec.coffee +++ b/spec/deserializer-manager-spec.coffee @@ -5,7 +5,7 @@ describe ".deserialize(state)", -> class Foo @deserialize: ({name}) -> new Foo(name) - constructor: (@name) -> + constructor: (@name) -> return beforeEach -> deserializer = new DeserializerManager() diff --git a/spec/editor-view-spec.coffee b/spec/editor-view-spec.coffee index 467266023..6d82bc428 100644 --- a/spec/editor-view-spec.coffee +++ b/spec/editor-view-spec.coffee @@ -681,7 +681,7 @@ describe "EditorView", -> editorView.attachToDom(heightInLines: 5) editorView.scrollToBottom() - spyOn(window, 'setInterval').andCallFake -> + spyOn(window, 'setInterval').andCallFake -> return # start editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [12, 0]) @@ -731,7 +731,7 @@ describe "EditorView", -> editorView.attachToDom(heightInLines: 5) editorView.scrollToBottom() - spyOn(window, 'setInterval').andCallFake -> + spyOn(window, 'setInterval').andCallFake -> return editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [12, 0]) originalScrollTop = editorView.scrollTop() diff --git a/spec/pane-spec.coffee b/spec/pane-spec.coffee index 04b1c2474..fe57a0728 100644 --- a/spec/pane-spec.coffee +++ b/spec/pane-spec.coffee @@ -6,7 +6,7 @@ PaneContainer = require '../src/pane-container' describe "Pane", -> class Item extends Model @deserialize: ({name, uri}) -> new this(name, uri) - constructor: (@name, @uri) -> + constructor: (@name, @uri) -> return getUri: -> @uri getPath: -> @path serialize: -> {deserializer: 'Item', @name, @uri} diff --git a/spec/pane-view-spec.coffee b/spec/pane-view-spec.coffee index 9f73884b5..408090786 100644 --- a/spec/pane-view-spec.coffee +++ b/spec/pane-view-spec.coffee @@ -11,7 +11,7 @@ describe "PaneView", -> class TestView extends View @deserialize: ({id, text}) -> new TestView({id, text}) @content: ({id, text}) -> @div class: 'test-view', id: id, tabindex: -1, text - initialize: ({@id, @text}) -> + initialize: ({@id, @text}) -> return serialize: -> { deserializer: 'TestView', @id, @text } getUri: -> @id isEqual: (other) -> other? and @id == other.id and @text == other.text diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 25ae5fb7b..1a6d54368 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -103,7 +103,7 @@ beforeEach -> spyOn(EditorView.prototype, 'requestDisplayUpdate').andCallFake -> @updateDisplay() EditorComponent.performSyncUpdates = true - spyOn(WorkspaceView.prototype, 'setTitle').andCallFake (@title) -> + spyOn(WorkspaceView.prototype, 'setTitle').andCallFake (@title) -> return spyOn(window, "setTimeout").andCallFake window.fakeSetTimeout spyOn(window, "clearTimeout").andCallFake window.fakeClearTimeout spyOn(pathwatcher.File.prototype, "detectResurrectionAfterDelay").andCallFake -> @detectResurrection() diff --git a/spec/time-reporter.coffee b/spec/time-reporter.coffee index a02c47286..e1e9c6a0e 100644 --- a/spec/time-reporter.coffee +++ b/spec/time-reporter.coffee @@ -18,7 +18,7 @@ class TimeReporter extends jasmine.Reporter log ?= (line) -> console.log(line) log "Longest running suites:" suites = _.map(window.timedSuites, (key, value) -> [value, key]) - for suite in _.sortBy(suites, (suite) => -suite[1])[0...number] + for suite in _.sortBy(suites, (suite) -> -suite[1])[0...number] time = Math.round(suite[1] / 100) / 10 log " #{suite[0]} (#{time}s)" undefined diff --git a/spec/window-spec.coffee b/spec/window-spec.coffee index 6a449cc5c..6603bee04 100644 --- a/spec/window-spec.coffee +++ b/spec/window-spec.coffee @@ -138,8 +138,8 @@ describe "Window", -> event = $.Event(type) event.originalEvent = { dataTransfer } - event.preventDefault = -> - event.stopPropagation = -> + event.preventDefault = -> return + event.stopPropagation = -> return event describe "when a file is dragged to window", -> diff --git a/src/command-installer.coffee b/src/command-installer.coffee index 2c71ba74c..f1a6ab6e3 100644 --- a/src/command-installer.coffee +++ b/src/command-installer.coffee @@ -41,7 +41,7 @@ module.exports = callback() return - symlinkCommand commandPath, destinationPath, (error) => + symlinkCommand commandPath, destinationPath, (error) -> if askForPrivilege and error?.code is 'EACCES' try error = null diff --git a/src/config.coffee b/src/config.coffee index 633a310c6..2c280aa27 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -39,7 +39,7 @@ class Config fs.makeTreeSync(@configDirPath) - queue = async.queue ({sourcePath, destinationPath}, callback) => + queue = async.queue ({sourcePath, destinationPath}, callback) -> fs.copy(sourcePath, destinationPath, callback) queue.drain = done diff --git a/src/cursor.coffee b/src/cursor.coffee index f228e2158..720004bdd 100644 --- a/src/cursor.coffee +++ b/src/cursor.coffee @@ -120,7 +120,7 @@ class Cursor extends Model # (default: true) # # Returns a {RegExp}. - wordRegExp: ({includeNonWordCharacters}={})-> + wordRegExp: ({includeNonWordCharacters}={}) -> includeNonWordCharacters ?= true nonWordCharacters = atom.config.get('editor.nonWordCharacters') segments = ["^[\t ]*$"] @@ -286,7 +286,7 @@ class Cursor extends Model position = @getBufferPosition() scanRange = @getCurrentLineBufferRange() endOfLeadingWhitespace = null - @editor.scanInBufferRange /^[ \t]*/, scanRange, ({range}) => + @editor.scanInBufferRange /^[ \t]*/, scanRange, ({range}) -> endOfLeadingWhitespace = range.end @setBufferPosition(endOfLeadingWhitespace) if endOfLeadingWhitespace.isGreaterThan(position) @@ -342,7 +342,7 @@ class Cursor extends Model scanRange = [[previousNonBlankRow, 0], currentBufferPosition] beginningOfWordPosition = null - @editor.backwardsScanInBufferRange (options.wordRegex ? @wordRegExp(options)), scanRange, ({range, stop}) => + @editor.backwardsScanInBufferRange (options.wordRegex ? @wordRegExp(options)), scanRange, ({range, stop}) -> if range.end.isGreaterThanOrEqual(currentBufferPosition) or allowPrevious beginningOfWordPosition = range.start if not beginningOfWordPosition?.isEqual(currentBufferPosition) @@ -363,7 +363,7 @@ class Cursor extends Model scanRange = [[previousNonBlankRow, 0], currentBufferPosition] beginningOfWordPosition = null - @editor.backwardsScanInBufferRange (options.wordRegex ? @wordRegExp()), scanRange, ({range, stop}) => + @editor.backwardsScanInBufferRange (options.wordRegex ? @wordRegExp()), scanRange, ({range, stop}) -> if range.start.row < currentBufferPosition.row and currentBufferPosition.column > 0 # force it to stop at the beginning of each line beginningOfWordPosition = new Point(currentBufferPosition.row, 0) @@ -384,7 +384,7 @@ class Cursor extends Model scanRange = [currentBufferPosition, @editor.getEofBufferPosition()] endOfWordPosition = null - @editor.scanInBufferRange (options.wordRegex ? @wordRegExp()), scanRange, ({range, stop}) => + @editor.scanInBufferRange (options.wordRegex ? @wordRegExp()), scanRange, ({range, stop}) -> if range.start.row > currentBufferPosition.row # force it to stop at the beginning of each line endOfWordPosition = new Point(range.start.row, 0) @@ -414,7 +414,7 @@ class Cursor extends Model scanRange = [currentBufferPosition, @editor.getEofBufferPosition()] endOfWordPosition = null - @editor.scanInBufferRange (options.wordRegex ? @wordRegExp(options)), scanRange, ({range, stop}) => + @editor.scanInBufferRange (options.wordRegex ? @wordRegExp(options)), scanRange, ({range, stop}) -> if range.start.isLessThanOrEqual(currentBufferPosition) or allowNext endOfWordPosition = range.end if not endOfWordPosition?.isEqual(currentBufferPosition) @@ -435,7 +435,7 @@ class Cursor extends Model scanRange = [start, @editor.getEofBufferPosition()] beginningOfNextWordPosition = null - @editor.scanInBufferRange (options.wordRegex ? @wordRegExp()), scanRange, ({range, stop}) => + @editor.scanInBufferRange (options.wordRegex ? @wordRegExp()), scanRange, ({range, stop}) -> beginningOfNextWordPosition = range.start stop() @@ -477,7 +477,7 @@ class Cursor extends Model {row, column} = eof position = new Point(row, column - 1) - @editor.scanInBufferRange /^\n*$/g, scanRange, ({range, stop}) => + @editor.scanInBufferRange /^\n*$/g, scanRange, ({range, stop}) -> if !range.start.isEqual(start) position = range.start stop() @@ -490,7 +490,7 @@ class Cursor extends Model scanRange = [[row-1, column], [0,0]] position = new Point(0, 0) zero = new Point(0,0) - @editor.backwardsScanInBufferRange /^\n*$/g, scanRange, ({range, stop}) => + @editor.backwardsScanInBufferRange /^\n*$/g, scanRange, ({range, stop}) -> if !range.start.isEqual(zero) position = range.start stop() diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index fff9f69a6..9fde6c9f8 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -980,7 +980,7 @@ class DisplayBuffer extends Model @tokenizedBuffer.destroy() @unsubscribe() - logLines: (start=0, end=@getLastRow())-> + logLines: (start=0, end=@getLastRow()) -> for row in [start..end] line = @lineForRow(row).text console.log row, @bufferRowForScreenRow(row), line, line.length diff --git a/src/editor-component.coffee b/src/editor-component.coffee index ebe970a52..41e214db9 100644 --- a/src/editor-component.coffee +++ b/src/editor-component.coffee @@ -410,105 +410,105 @@ EditorComponent = React.createClass {parentView, editor, mini} = @props @addCommandListeners - 'core:move-left': => editor.moveCursorLeft() - 'core:move-right': => editor.moveCursorRight() - 'core:select-left': => editor.selectLeft() - 'core:select-right': => editor.selectRight() - 'core:select-all': => editor.selectAll() - 'core:backspace': => editor.backspace() - 'core:delete': => editor.delete() - 'core:undo': => editor.undo() - 'core:redo': => editor.redo() - 'core:cut': => editor.cutSelectedText() - 'core:copy': => editor.copySelectedText() - 'core:paste': => editor.pasteText() - 'editor:move-to-previous-word': => editor.moveCursorToPreviousWord() - 'editor:select-word': => editor.selectWord() + 'core:move-left': -> editor.moveCursorLeft() + 'core:move-right': -> editor.moveCursorRight() + 'core:select-left': -> editor.selectLeft() + 'core:select-right': -> editor.selectRight() + 'core:select-all': -> editor.selectAll() + 'core:backspace': -> editor.backspace() + 'core:delete': -> editor.delete() + 'core:undo': -> editor.undo() + 'core:redo': -> editor.redo() + 'core:cut': -> editor.cutSelectedText() + 'core:copy': -> editor.copySelectedText() + 'core:paste': -> editor.pasteText() + 'editor:move-to-previous-word': -> editor.moveCursorToPreviousWord() + 'editor:select-word': -> editor.selectWord() 'editor:consolidate-selections': @consolidateSelections - 'editor:delete-to-beginning-of-word': => editor.deleteToBeginningOfWord() - 'editor:delete-to-beginning-of-line': => editor.deleteToBeginningOfLine() - 'editor:delete-to-end-of-line': => editor.deleteToEndOfLine() - 'editor:delete-to-end-of-word': => editor.deleteToEndOfWord() - 'editor:delete-line': => editor.deleteLine() - 'editor:cut-to-end-of-line': => editor.cutToEndOfLine() - 'editor:move-to-beginning-of-next-paragraph': => editor.moveCursorToBeginningOfNextParagraph() - 'editor:move-to-beginning-of-previous-paragraph': => editor.moveCursorToBeginningOfPreviousParagraph() - 'editor:move-to-beginning-of-screen-line': => editor.moveCursorToBeginningOfScreenLine() - 'editor:move-to-beginning-of-line': => editor.moveCursorToBeginningOfLine() - 'editor:move-to-end-of-screen-line': => editor.moveCursorToEndOfScreenLine() - 'editor:move-to-end-of-line': => editor.moveCursorToEndOfLine() - 'editor:move-to-first-character-of-line': => editor.moveCursorToFirstCharacterOfLine() - 'editor:move-to-beginning-of-word': => editor.moveCursorToBeginningOfWord() - 'editor:move-to-end-of-word': => editor.moveCursorToEndOfWord() - 'editor:move-to-beginning-of-next-word': => editor.moveCursorToBeginningOfNextWord() - 'editor:move-to-previous-word-boundary': => editor.moveCursorToPreviousWordBoundary() - 'editor:move-to-next-word-boundary': => editor.moveCursorToNextWordBoundary() - 'editor:select-to-beginning-of-next-paragraph': => editor.selectToBeginningOfNextParagraph() - 'editor:select-to-beginning-of-previous-paragraph': => editor.selectToBeginningOfPreviousParagraph() - 'editor:select-to-end-of-line': => editor.selectToEndOfLine() - 'editor:select-to-beginning-of-line': => editor.selectToBeginningOfLine() - 'editor:select-to-end-of-word': => editor.selectToEndOfWord() - 'editor:select-to-beginning-of-word': => editor.selectToBeginningOfWord() - 'editor:select-to-beginning-of-next-word': => editor.selectToBeginningOfNextWord() - 'editor:select-to-next-word-boundary': => editor.selectToNextWordBoundary() - 'editor:select-to-previous-word-boundary': => editor.selectToPreviousWordBoundary() - 'editor:select-to-first-character-of-line': => editor.selectToFirstCharacterOfLine() - 'editor:select-line': => editor.selectLine() - 'editor:transpose': => editor.transpose() - 'editor:upper-case': => editor.upperCase() - 'editor:lower-case': => editor.lowerCase() + 'editor:delete-to-beginning-of-word': -> editor.deleteToBeginningOfWord() + 'editor:delete-to-beginning-of-line': -> editor.deleteToBeginningOfLine() + 'editor:delete-to-end-of-line': -> editor.deleteToEndOfLine() + 'editor:delete-to-end-of-word': -> editor.deleteToEndOfWord() + 'editor:delete-line': -> editor.deleteLine() + 'editor:cut-to-end-of-line': -> editor.cutToEndOfLine() + 'editor:move-to-beginning-of-next-paragraph': -> editor.moveCursorToBeginningOfNextParagraph() + 'editor:move-to-beginning-of-previous-paragraph': -> editor.moveCursorToBeginningOfPreviousParagraph() + 'editor:move-to-beginning-of-screen-line': -> editor.moveCursorToBeginningOfScreenLine() + 'editor:move-to-beginning-of-line': -> editor.moveCursorToBeginningOfLine() + 'editor:move-to-end-of-screen-line': -> editor.moveCursorToEndOfScreenLine() + 'editor:move-to-end-of-line': -> editor.moveCursorToEndOfLine() + 'editor:move-to-first-character-of-line': -> editor.moveCursorToFirstCharacterOfLine() + 'editor:move-to-beginning-of-word': -> editor.moveCursorToBeginningOfWord() + 'editor:move-to-end-of-word': -> editor.moveCursorToEndOfWord() + 'editor:move-to-beginning-of-next-word': -> editor.moveCursorToBeginningOfNextWord() + 'editor:move-to-previous-word-boundary': -> editor.moveCursorToPreviousWordBoundary() + 'editor:move-to-next-word-boundary': -> editor.moveCursorToNextWordBoundary() + 'editor:select-to-beginning-of-next-paragraph': -> editor.selectToBeginningOfNextParagraph() + 'editor:select-to-beginning-of-previous-paragraph': -> editor.selectToBeginningOfPreviousParagraph() + 'editor:select-to-end-of-line': -> editor.selectToEndOfLine() + 'editor:select-to-beginning-of-line': -> editor.selectToBeginningOfLine() + 'editor:select-to-end-of-word': -> editor.selectToEndOfWord() + 'editor:select-to-beginning-of-word': -> editor.selectToBeginningOfWord() + 'editor:select-to-beginning-of-next-word': -> editor.selectToBeginningOfNextWord() + 'editor:select-to-next-word-boundary': -> editor.selectToNextWordBoundary() + 'editor:select-to-previous-word-boundary': -> editor.selectToPreviousWordBoundary() + 'editor:select-to-first-character-of-line': -> editor.selectToFirstCharacterOfLine() + 'editor:select-line': -> editor.selectLine() + 'editor:transpose': -> editor.transpose() + 'editor:upper-case': -> editor.upperCase() + 'editor:lower-case': -> editor.lowerCase() unless mini @addCommandListeners - 'core:move-up': => editor.moveCursorUp() - 'core:move-down': => editor.moveCursorDown() - 'core:move-to-top': => editor.moveCursorToTop() - 'core:move-to-bottom': => editor.moveCursorToBottom() - 'core:page-up': => editor.pageUp() - 'core:page-down': => editor.pageDown() - 'core:select-up': => editor.selectUp() - 'core:select-down': => editor.selectDown() - 'core:select-to-top': => editor.selectToTop() - 'core:select-to-bottom': => editor.selectToBottom() - 'core:select-page-up': => editor.selectPageUp() - 'core:select-page-down': => editor.selectPageDown() - 'editor:indent': => editor.indent() - 'editor:auto-indent': => editor.autoIndentSelectedRows() - 'editor:indent-selected-rows': => editor.indentSelectedRows() - 'editor:outdent-selected-rows': => editor.outdentSelectedRows() - 'editor:newline': => editor.insertNewline() - 'editor:newline-below': => editor.insertNewlineBelow() - 'editor:newline-above': => editor.insertNewlineAbove() - 'editor:add-selection-below': => editor.addSelectionBelow() - 'editor:add-selection-above': => editor.addSelectionAbove() - 'editor:split-selections-into-lines': => editor.splitSelectionsIntoLines() - 'editor:toggle-soft-tabs': => editor.toggleSoftTabs() - 'editor:toggle-soft-wrap': => editor.toggleSoftWrap() - 'editor:fold-all': => editor.foldAll() - 'editor:unfold-all': => editor.unfoldAll() - 'editor:fold-current-row': => editor.foldCurrentRow() - 'editor:unfold-current-row': => editor.unfoldCurrentRow() - 'editor:fold-selection': => editor.foldSelectedLines() - 'editor:fold-at-indent-level-1': => editor.foldAllAtIndentLevel(0) - 'editor:fold-at-indent-level-2': => editor.foldAllAtIndentLevel(1) - 'editor:fold-at-indent-level-3': => editor.foldAllAtIndentLevel(2) - 'editor:fold-at-indent-level-4': => editor.foldAllAtIndentLevel(3) - 'editor:fold-at-indent-level-5': => editor.foldAllAtIndentLevel(4) - 'editor:fold-at-indent-level-6': => editor.foldAllAtIndentLevel(5) - 'editor:fold-at-indent-level-7': => editor.foldAllAtIndentLevel(6) - 'editor:fold-at-indent-level-8': => editor.foldAllAtIndentLevel(7) - 'editor:fold-at-indent-level-9': => editor.foldAllAtIndentLevel(8) - 'editor:toggle-line-comments': => editor.toggleLineCommentsInSelection() - 'editor:log-cursor-scope': => editor.logCursorScope() - 'editor:checkout-head-revision': => atom.project.getRepo()?.checkoutHeadForEditor(editor) - 'editor:copy-path': => editor.copyPathToClipboard() - 'editor:move-line-up': => editor.moveLineUp() - 'editor:move-line-down': => editor.moveLineDown() - 'editor:duplicate-lines': => editor.duplicateLines() - 'editor:join-lines': => editor.joinLines() - 'editor:toggle-indent-guide': => atom.config.toggle('editor.showIndentGuide') - 'editor:toggle-line-numbers': => atom.config.toggle('editor.showLineNumbers') - 'editor:scroll-to-cursor': => editor.scrollToCursorPosition() + 'core:move-up': -> editor.moveCursorUp() + 'core:move-down': -> editor.moveCursorDown() + 'core:move-to-top': -> editor.moveCursorToTop() + 'core:move-to-bottom': -> editor.moveCursorToBottom() + 'core:page-up': -> editor.pageUp() + 'core:page-down': -> editor.pageDown() + 'core:select-up': -> editor.selectUp() + 'core:select-down': -> editor.selectDown() + 'core:select-to-top': -> editor.selectToTop() + 'core:select-to-bottom': -> editor.selectToBottom() + 'core:select-page-up': -> editor.selectPageUp() + 'core:select-page-down': -> editor.selectPageDown() + 'editor:indent': -> editor.indent() + 'editor:auto-indent': -> editor.autoIndentSelectedRows() + 'editor:indent-selected-rows': -> editor.indentSelectedRows() + 'editor:outdent-selected-rows': -> editor.outdentSelectedRows() + 'editor:newline': -> editor.insertNewline() + 'editor:newline-below': -> editor.insertNewlineBelow() + 'editor:newline-above': -> editor.insertNewlineAbove() + 'editor:add-selection-below': -> editor.addSelectionBelow() + 'editor:add-selection-above': -> editor.addSelectionAbove() + 'editor:split-selections-into-lines': -> editor.splitSelectionsIntoLines() + 'editor:toggle-soft-tabs': -> editor.toggleSoftTabs() + 'editor:toggle-soft-wrap': -> editor.toggleSoftWrap() + 'editor:fold-all': -> editor.foldAll() + 'editor:unfold-all': -> editor.unfoldAll() + 'editor:fold-current-row': -> editor.foldCurrentRow() + 'editor:unfold-current-row': -> editor.unfoldCurrentRow() + 'editor:fold-selection': -> editor.foldSelectedLines() + 'editor:fold-at-indent-level-1': -> editor.foldAllAtIndentLevel(0) + 'editor:fold-at-indent-level-2': -> editor.foldAllAtIndentLevel(1) + 'editor:fold-at-indent-level-3': -> editor.foldAllAtIndentLevel(2) + 'editor:fold-at-indent-level-4': -> editor.foldAllAtIndentLevel(3) + 'editor:fold-at-indent-level-5': -> editor.foldAllAtIndentLevel(4) + 'editor:fold-at-indent-level-6': -> editor.foldAllAtIndentLevel(5) + 'editor:fold-at-indent-level-7': -> editor.foldAllAtIndentLevel(6) + 'editor:fold-at-indent-level-8': -> editor.foldAllAtIndentLevel(7) + 'editor:fold-at-indent-level-9': -> editor.foldAllAtIndentLevel(8) + 'editor:toggle-line-comments': -> editor.toggleLineCommentsInSelection() + 'editor:log-cursor-scope': -> editor.logCursorScope() + 'editor:checkout-head-revision': -> editor.checkoutHead() + 'editor:copy-path': -> editor.copyPathToClipboard() + 'editor:move-line-up': -> editor.moveLineUp() + 'editor:move-line-down': -> editor.moveLineDown() + 'editor:duplicate-lines': -> editor.duplicateLines() + 'editor:join-lines': -> editor.joinLines() + 'editor:toggle-indent-guide': -> atom.config.toggle('editor.showIndentGuide') + 'editor:toggle-line-numbers': -> atom.config.toggle('editor.showLineNumbers') + 'editor:scroll-to-cursor': -> editor.scrollToCursorPosition() 'benchmark:scroll': @runScrollBenchmark addCommandListeners: (listenersByCommandName) -> diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 41fa8b3e3..7c002e554 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -243,8 +243,8 @@ class EditorView extends View 'editor:move-line-down': => @editor.moveLineDown() 'editor:duplicate-lines': => @editor.duplicateLines() 'editor:join-lines': => @editor.joinLines() - 'editor:toggle-indent-guide': => atom.config.toggle('editor.showIndentGuide') - 'editor:toggle-line-numbers': => atom.config.toggle('editor.showLineNumbers') + 'editor:toggle-indent-guide': -> atom.config.toggle('editor.showIndentGuide') + 'editor:toggle-line-numbers': -> atom.config.toggle('editor.showLineNumbers') 'editor:scroll-to-cursor': => @scrollToCursorPosition() documentation = {} @@ -270,7 +270,7 @@ class EditorView extends View insertText: (text, options) -> @editor.insertText(text, options) - setHeightInLines: (heightInLines)-> + setHeightInLines: (heightInLines) -> heightInLines ?= @calculateHeightInLines() @heightInLines = heightInLines if heightInLines diff --git a/src/editor.coffee b/src/editor.coffee index be99f71a3..bffc1804a 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -690,7 +690,7 @@ class Editor extends Model # Indent all lines intersecting selections. See {Selection::indent} for more # information. - indent: (options={})-> + indent: (options={}) -> options.autoIndent ?= @shouldAutoIndent() @mutateSelectedText (selection) -> selection.indent(options) @@ -1668,55 +1668,55 @@ class Editor extends Model # # This method may merge selections that end up intesecting. selectRight: -> - @expandSelectionsForward (selection) => selection.selectRight() + @expandSelectionsForward (selection) -> selection.selectRight() # Public: Move the cursor of each selection one character leftward while # preserving the selection's tail position. # # This method may merge selections that end up intesecting. selectLeft: -> - @expandSelectionsBackward (selection) => selection.selectLeft() + @expandSelectionsBackward (selection) -> selection.selectLeft() # Public: Move the cursor of each selection one character upward while # preserving the selection's tail position. # # This method may merge selections that end up intesecting. selectUp: (rowCount) -> - @expandSelectionsBackward (selection) => selection.selectUp(rowCount) + @expandSelectionsBackward (selection) -> selection.selectUp(rowCount) # Public: Move the cursor of each selection one character downward while # preserving the selection's tail position. # # This method may merge selections that end up intesecting. selectDown: (rowCount) -> - @expandSelectionsForward (selection) => selection.selectDown(rowCount) + @expandSelectionsForward (selection) -> selection.selectDown(rowCount) # Public: Select from the top of the buffer to the end of the last selection # in the buffer. # # This method merges multiple selections into a single selection. selectToTop: -> - @expandSelectionsBackward (selection) => selection.selectToTop() + @expandSelectionsBackward (selection) -> selection.selectToTop() # Public: Select all text in the buffer. # # This method merges multiple selections into a single selection. selectAll: -> - @expandSelectionsForward (selection) => selection.selectAll() + @expandSelectionsForward (selection) -> selection.selectAll() # Public: Selects from the top of the first selection in the buffer to the end # of the buffer. # # This method merges multiple selections into a single selection. selectToBottom: -> - @expandSelectionsForward (selection) => selection.selectToBottom() + @expandSelectionsForward (selection) -> selection.selectToBottom() # Public: Move the cursor of each selection to the beginning of its line # while preserving the selection's tail position. # # This method may merge selections that end up intesecting. selectToBeginningOfLine: -> - @expandSelectionsBackward (selection) => selection.selectToBeginningOfLine() + @expandSelectionsBackward (selection) -> selection.selectToBeginningOfLine() # Public: Move the cursor of each selection to the first non-whitespace # character of its line while preserving the selection's tail position. If the @@ -1725,34 +1725,34 @@ class Editor extends Model # # This method may merge selections that end up intersecting. selectToFirstCharacterOfLine: -> - @expandSelectionsBackward (selection) => selection.selectToFirstCharacterOfLine() + @expandSelectionsBackward (selection) -> selection.selectToFirstCharacterOfLine() # Public: Move the cursor of each selection to the end of its line while # preserving the selection's tail position. # # This method may merge selections that end up intersecting. selectToEndOfLine: -> - @expandSelectionsForward (selection) => selection.selectToEndOfLine() + @expandSelectionsForward (selection) -> selection.selectToEndOfLine() # Public: For each selection, move its cursor to the preceding word boundary # while maintaining the selection's tail position. # # This method may merge selections that end up intersecting. selectToPreviousWordBoundary: -> - @expandSelectionsBackward (selection) => selection.selectToPreviousWordBoundary() + @expandSelectionsBackward (selection) -> selection.selectToPreviousWordBoundary() # Public: For each selection, move its cursor to the next word boundary while # maintaining the selection's tail position. # # This method may merge selections that end up intersecting. selectToNextWordBoundary: -> - @expandSelectionsForward (selection) => selection.selectToNextWordBoundary() + @expandSelectionsForward (selection) -> selection.selectToNextWordBoundary() # Public: For each cursor, select the containing line. # # This method merges selections on successive lines. selectLine: -> - @expandSelectionsForward (selection) => selection.selectLine() + @expandSelectionsForward (selection) -> selection.selectLine() # Public: Add a similarly-shaped selection to the next eligible line below # each selection. @@ -1763,7 +1763,7 @@ class Editor extends Model # selection to the next line that is long enough for a non-empty selection # starting at the same column as the current selection to be added to it. addSelectionBelow: -> - @expandSelectionsForward (selection) => selection.addSelectionBelow() + @expandSelectionsForward (selection) -> selection.addSelectionBelow() # Public: Add a similarly-shaped selection to the next eligible line above # each selection. @@ -1774,7 +1774,7 @@ class Editor extends Model # selection to the next line that is long enough for a non-empty selection # starting at the same column as the current selection to be added to it. addSelectionAbove: -> - @expandSelectionsBackward (selection) => selection.addSelectionAbove() + @expandSelectionsBackward (selection) -> selection.addSelectionAbove() # Public: Split multi-line selections into one selection per line. # @@ -1799,7 +1799,7 @@ class Editor extends Model # If the selection is empty, the characters preceding and following the cursor # are swapped. Otherwise, the selected characters are reversed. transpose: -> - @mutateSelectedText (selection) => + @mutateSelectedText (selection) -> if selection.isEmpty() selection.selectRight() text = selection.getText() @@ -1814,14 +1814,14 @@ class Editor extends Model # For each selection, if the selection is empty, converts the containing word # to upper case. Otherwise convert the selected text to upper case. upperCase: -> - @replaceSelectedText selectWordIfEmpty:true, (text) => text.toUpperCase() + @replaceSelectedText selectWordIfEmpty:true, (text) -> text.toUpperCase() # Public: Convert the selected text to lower case. # # For each selection, if the selection is empty, converts the containing word # to upper case. Otherwise convert the selected text to upper case. lowerCase: -> - @replaceSelectedText selectWordIfEmpty:true, (text) => text.toLowerCase() + @replaceSelectedText selectWordIfEmpty:true, (text) -> text.toLowerCase() # Convert multiple lines to a single line. # @@ -1839,39 +1839,39 @@ class Editor extends Model # Operates on all selections. Moves the cursor to the beginning of the # containing word while preserving the selection's tail position. selectToBeginningOfWord: -> - @expandSelectionsBackward (selection) => selection.selectToBeginningOfWord() + @expandSelectionsBackward (selection) -> selection.selectToBeginningOfWord() # Public: Expand selections to the end of their containing word. # # Operates on all selections. Moves the cursor to the end of the containing # word while preserving the selection's tail position. selectToEndOfWord: -> - @expandSelectionsForward (selection) => selection.selectToEndOfWord() + @expandSelectionsForward (selection) -> selection.selectToEndOfWord() # Public: Expand selections to the beginning of the next word. # # Operates on all selections. Moves the cursor to the beginning of the next # word while preserving the selection's tail position. selectToBeginningOfNextWord: -> - @expandSelectionsForward (selection) => selection.selectToBeginningOfNextWord() + @expandSelectionsForward (selection) -> selection.selectToBeginningOfNextWord() # Public: Select the word containing each cursor. selectWord: -> - @expandSelectionsForward (selection) => selection.selectWord() + @expandSelectionsForward (selection) -> selection.selectWord() # Public: Expand selections to the beginning of the next paragraph. # # Operates on all selections. Moves the cursor to the beginning of the next # paragraph while preserving the selection's tail position. selectToBeginningOfNextParagraph: -> - @expandSelectionsForward (selection) => selection.selectToBeginningOfNextParagraph() + @expandSelectionsForward (selection) -> selection.selectToBeginningOfNextParagraph() # Public: Expand selections to the beginning of the next paragraph. # # Operates on all selections. Moves the cursor to the beginning of the next # paragraph while preserving the selection's tail position. selectToBeginningOfPreviousParagraph: -> - @expandSelectionsBackward (selection) => selection.selectToBeginningOfPreviousParagraph() + @expandSelectionsBackward (selection) -> selection.selectToBeginningOfPreviousParagraph() # Public: Select the range of the given marker if it is valid. # diff --git a/src/gutter-view.coffee b/src/gutter-view.coffee index aabc515fc..088d3740f 100644 --- a/src/gutter-view.coffee +++ b/src/gutter-view.coffee @@ -39,14 +39,14 @@ class GutterView extends View else editor.getSelection().setScreenRange([[startRow, 0], [startRow, 0]]) - moveHandler = (e) => + moveHandler = (e) -> start = startRow end = editorView.screenPositionFromMouseEvent(e).row if end > start then end++ else start++ editor.getSelection().setScreenRange([[start, 0], [end, 0]]) $(document).on "mousemove.gutter-#{editorView.id}", moveHandler - $(document).one "mouseup.gutter-#{editorView.id}", => $(document).off 'mousemove', moveHandler + $(document).one "mouseup.gutter-#{editorView.id}", -> $(document).off 'mousemove', moveHandler # Retrieves the containing {EditorView}. # @@ -89,7 +89,7 @@ class GutterView extends View # * klass: string class name # # Returns true if the class was added to any lines - addClassToAllLines: (klass)-> + addClassToAllLines: (klass) -> elements = @getLineNumberElements() el.classList.add(klass) for el in elements !!elements.length @@ -99,7 +99,7 @@ class GutterView extends View # * klass: string class name. Can only be one class name. i.e. 'my-class' # # Returns true if the class was removed from any lines - removeClassFromAllLines: (klass)-> + removeClassFromAllLines: (klass) -> # This is faster than calling $.removeClass on all lines, and faster than # making a new array and iterating through it. elements = @getLineNumberElementsForClass(klass) @@ -113,7 +113,7 @@ class GutterView extends View # * klass: string class name # # Returns true if there were lines the class was added to - addClassToLine: (bufferRow, klass)-> + addClassToLine: (bufferRow, klass) -> elements = @getLineNumberElement(bufferRow) el.classList.add(klass) for el in elements !!elements.length @@ -124,7 +124,7 @@ class GutterView extends View # * klass: string class name # # Returns true if there were lines the class was removed from - removeClassFromLine: (bufferRow, klass)-> + removeClassFromLine: (bufferRow, klass) -> classesRemoved = false elements = @getLineNumberElement(bufferRow) for el in elements diff --git a/src/package.coffee b/src/package.coffee index 707e7b591..cf16c3a7e 100644 --- a/src/package.coffee +++ b/src/package.coffee @@ -325,7 +325,7 @@ class Package disableEventHandlersOnBubblePath: (event) -> bubblePathEventHandlers = [] - disabledHandler = -> + disabledHandler = -> return $ ?= require('./space-pen-extensions').$ element = $(event.target) while element.length diff --git a/src/react-editor-view.coffee b/src/react-editor-view.coffee index d7e12f664..bd5df1e69 100644 --- a/src/react-editor-view.coffee +++ b/src/react-editor-view.coffee @@ -181,13 +181,13 @@ class ReactEditorView extends View getFontFamily: -> @component?.getFontFamily() - setFontFamily: (fontFamily)-> + setFontFamily: (fontFamily) -> @component?.setFontFamily(fontFamily) getFontSize: -> @component?.getFontSize() - setFontSize: (fontSize)-> + setFontSize: (fontSize) -> @component?.setFontSize(fontSize) setWidthInChars: (widthInChars) -> @@ -226,13 +226,13 @@ class ReactEditorView extends View setInputEnabled: (inputEnabled) -> @component.setInputEnabled(inputEnabled) - requestDisplayUpdate: -> # No-op shim for find-and-replace + requestDisplayUpdate: -> return # No-op shim for find-and-replace - updateDisplay: -> # No-op shim for package specs + updateDisplay: -> return # No-op shim for package specs - resetDisplay: -> # No-op shim for package specs + resetDisplay: -> return # No-op shim for package specs - redraw: -> # No-op shim + redraw: -> return # No-op shim setPlaceholderText: (placeholderText) -> if @component? diff --git a/src/scoped-properties.coffee b/src/scoped-properties.coffee index 47d239a5a..9a647ae93 100644 --- a/src/scoped-properties.coffee +++ b/src/scoped-properties.coffee @@ -9,7 +9,7 @@ class ScopedProperties else callback(null, new ScopedProperties(scopedPropertiesPath, scopedProperties)) - constructor: (@path, @scopedProperties) -> + constructor: (@path, @scopedProperties) -> return activate: -> for selector, properties of @scopedProperties diff --git a/src/select-list-view.coffee b/src/select-list-view.coffee index 8776b2757..ab9b6beb3 100644 --- a/src/select-list-view.coffee +++ b/src/select-list-view.coffee @@ -177,7 +177,7 @@ class SelectListView extends View # Public: Set the maximum numbers of items to display in the list. # # maxItems - The maximum {Number} of items to display. - setMaxItems: (@maxItems) -> + setMaxItems: (@maxItems) -> return selectPreviousItemView: -> view = @getSelectedItemView().prev() @@ -256,7 +256,7 @@ class SelectListView extends View # editor. # # Returns the property name to fuzzy filter by. - getFilterKey: -> + getFilterKey: -> return # Public: Focus the fuzzy filter editor view. focusFilterEditor: -> diff --git a/src/selection.coffee b/src/selection.coffee index ab7c91006..b182f864d 100644 --- a/src/selection.coffee +++ b/src/selection.coffee @@ -381,7 +381,7 @@ class Selection extends Model # options - A {Object} with the keys: # :autoIndent - If `true`, the line is indented to an automatically-inferred # level. Otherwise, {Editor::getTabText} is inserted. - indent: ({ autoIndent }={})-> + indent: ({ autoIndent }={}) -> { row, column } = @cursor.getBufferPosition() if @isEmpty() diff --git a/src/task-bootstrap.coffee b/src/task-bootstrap.coffee index 4ed618d1a..3eee1dda2 100644 --- a/src/task-bootstrap.coffee +++ b/src/task-bootstrap.coffee @@ -2,22 +2,22 @@ handler = null setupGlobals = -> - global.attachEvent = -> + global.attachEvent = -> return console = warn: -> emit 'task:warn', arguments... log: -> emit 'task:log', arguments... error: -> emit 'task:error', arguments... - trace: -> + trace: -> return global.__defineGetter__ 'console', -> console global.document = createElement: -> - setAttribute: -> + setAttribute: -> return getElementsByTagName: -> [] - appendChild: -> + appendChild: -> return documentElement: - insertBefore: -> - removeChild: -> + insertBefore: -> return + removeChild: -> return getElementById: -> {} createComment: -> {} createDocumentFragment: -> {} diff --git a/src/tokenized-buffer.coffee b/src/tokenized-buffer.coffee index b227d57d7..a657150de 100644 --- a/src/tokenized-buffer.coffee +++ b/src/tokenized-buffer.coffee @@ -90,7 +90,7 @@ class TokenizedBuffer extends Model # Specifies the tab length. # # tabLength - A {Number} that defines the new tab length. - setTabLength: (@tabLength) -> + setTabLength: (@tabLength) -> return setInvisibles: (invisibles) -> if invisibles isnt @invisibles From cbe5593381f7c1582c8b8b511bc22ab3b6b5c0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Sch=C3=BC=C3=9Fler?= Date: Thu, 14 Aug 2014 19:38:38 +0200 Subject: [PATCH 2/2] Do not use "-> return" to mark empty function --- spec/atom-reporter.coffee | 2 +- spec/context-menu-manager-spec.coffee | 2 +- spec/deserializer-manager-spec.coffee | 2 +- spec/editor-view-spec.coffee | 4 ++-- spec/pane-spec.coffee | 2 +- spec/pane-view-spec.coffee | 2 +- spec/spec-helper.coffee | 2 +- spec/window-spec.coffee | 4 ++-- src/package.coffee | 2 +- src/react-editor-view.coffee | 8 ++++---- src/scoped-properties.coffee | 2 +- src/select-list-view.coffee | 4 ++-- src/task-bootstrap.coffee | 12 ++++++------ src/tokenized-buffer.coffee | 2 +- 14 files changed, 25 insertions(+), 25 deletions(-) diff --git a/spec/atom-reporter.coffee b/spec/atom-reporter.coffee index 6d9940ec4..259665fd1 100644 --- a/spec/atom-reporter.coffee +++ b/spec/atom-reporter.coffee @@ -84,7 +84,7 @@ class AtomReporter extends View else @message.text "#{@failedCount} failures" - reportSuiteResults: (suite) -> return + reportSuiteResults: (suite) -> reportSpecResults: (spec) -> @completeSpecCount++ diff --git a/spec/context-menu-manager-spec.coffee b/spec/context-menu-manager-spec.coffee index 152944b61..4ec1c5b8d 100644 --- a/spec/context-menu-manager-spec.coffee +++ b/spec/context-menu-manager-spec.coffee @@ -161,7 +161,7 @@ describe "ContextMenuManager", -> describe "executeBuildHandlers", -> menuTemplate = [ label: 'label' - executeAtBuild: -> return + executeAtBuild: -> ] event = target: null diff --git a/spec/deserializer-manager-spec.coffee b/spec/deserializer-manager-spec.coffee index 6c9761ef0..3a2bf95e4 100644 --- a/spec/deserializer-manager-spec.coffee +++ b/spec/deserializer-manager-spec.coffee @@ -5,7 +5,7 @@ describe ".deserialize(state)", -> class Foo @deserialize: ({name}) -> new Foo(name) - constructor: (@name) -> return + constructor: (@name) -> beforeEach -> deserializer = new DeserializerManager() diff --git a/spec/editor-view-spec.coffee b/spec/editor-view-spec.coffee index 6d82bc428..467266023 100644 --- a/spec/editor-view-spec.coffee +++ b/spec/editor-view-spec.coffee @@ -681,7 +681,7 @@ describe "EditorView", -> editorView.attachToDom(heightInLines: 5) editorView.scrollToBottom() - spyOn(window, 'setInterval').andCallFake -> return + spyOn(window, 'setInterval').andCallFake -> # start editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [12, 0]) @@ -731,7 +731,7 @@ describe "EditorView", -> editorView.attachToDom(heightInLines: 5) editorView.scrollToBottom() - spyOn(window, 'setInterval').andCallFake -> return + spyOn(window, 'setInterval').andCallFake -> editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [12, 0]) originalScrollTop = editorView.scrollTop() diff --git a/spec/pane-spec.coffee b/spec/pane-spec.coffee index fe57a0728..04b1c2474 100644 --- a/spec/pane-spec.coffee +++ b/spec/pane-spec.coffee @@ -6,7 +6,7 @@ PaneContainer = require '../src/pane-container' describe "Pane", -> class Item extends Model @deserialize: ({name, uri}) -> new this(name, uri) - constructor: (@name, @uri) -> return + constructor: (@name, @uri) -> getUri: -> @uri getPath: -> @path serialize: -> {deserializer: 'Item', @name, @uri} diff --git a/spec/pane-view-spec.coffee b/spec/pane-view-spec.coffee index 408090786..9f73884b5 100644 --- a/spec/pane-view-spec.coffee +++ b/spec/pane-view-spec.coffee @@ -11,7 +11,7 @@ describe "PaneView", -> class TestView extends View @deserialize: ({id, text}) -> new TestView({id, text}) @content: ({id, text}) -> @div class: 'test-view', id: id, tabindex: -1, text - initialize: ({@id, @text}) -> return + initialize: ({@id, @text}) -> serialize: -> { deserializer: 'TestView', @id, @text } getUri: -> @id isEqual: (other) -> other? and @id == other.id and @text == other.text diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 1a6d54368..25ae5fb7b 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -103,7 +103,7 @@ beforeEach -> spyOn(EditorView.prototype, 'requestDisplayUpdate').andCallFake -> @updateDisplay() EditorComponent.performSyncUpdates = true - spyOn(WorkspaceView.prototype, 'setTitle').andCallFake (@title) -> return + spyOn(WorkspaceView.prototype, 'setTitle').andCallFake (@title) -> spyOn(window, "setTimeout").andCallFake window.fakeSetTimeout spyOn(window, "clearTimeout").andCallFake window.fakeClearTimeout spyOn(pathwatcher.File.prototype, "detectResurrectionAfterDelay").andCallFake -> @detectResurrection() diff --git a/spec/window-spec.coffee b/spec/window-spec.coffee index 6603bee04..6a449cc5c 100644 --- a/spec/window-spec.coffee +++ b/spec/window-spec.coffee @@ -138,8 +138,8 @@ describe "Window", -> event = $.Event(type) event.originalEvent = { dataTransfer } - event.preventDefault = -> return - event.stopPropagation = -> return + event.preventDefault = -> + event.stopPropagation = -> event describe "when a file is dragged to window", -> diff --git a/src/package.coffee b/src/package.coffee index cf16c3a7e..707e7b591 100644 --- a/src/package.coffee +++ b/src/package.coffee @@ -325,7 +325,7 @@ class Package disableEventHandlersOnBubblePath: (event) -> bubblePathEventHandlers = [] - disabledHandler = -> return + disabledHandler = -> $ ?= require('./space-pen-extensions').$ element = $(event.target) while element.length diff --git a/src/react-editor-view.coffee b/src/react-editor-view.coffee index bd5df1e69..3b166cbbf 100644 --- a/src/react-editor-view.coffee +++ b/src/react-editor-view.coffee @@ -226,13 +226,13 @@ class ReactEditorView extends View setInputEnabled: (inputEnabled) -> @component.setInputEnabled(inputEnabled) - requestDisplayUpdate: -> return # No-op shim for find-and-replace + requestDisplayUpdate: -> # No-op shim for find-and-replace - updateDisplay: -> return # No-op shim for package specs + updateDisplay: -> # No-op shim for package specs - resetDisplay: -> return # No-op shim for package specs + resetDisplay: -> # No-op shim for package specs - redraw: -> return # No-op shim + redraw: -> # No-op shim setPlaceholderText: (placeholderText) -> if @component? diff --git a/src/scoped-properties.coffee b/src/scoped-properties.coffee index 9a647ae93..47d239a5a 100644 --- a/src/scoped-properties.coffee +++ b/src/scoped-properties.coffee @@ -9,7 +9,7 @@ class ScopedProperties else callback(null, new ScopedProperties(scopedPropertiesPath, scopedProperties)) - constructor: (@path, @scopedProperties) -> return + constructor: (@path, @scopedProperties) -> activate: -> for selector, properties of @scopedProperties diff --git a/src/select-list-view.coffee b/src/select-list-view.coffee index ab9b6beb3..8776b2757 100644 --- a/src/select-list-view.coffee +++ b/src/select-list-view.coffee @@ -177,7 +177,7 @@ class SelectListView extends View # Public: Set the maximum numbers of items to display in the list. # # maxItems - The maximum {Number} of items to display. - setMaxItems: (@maxItems) -> return + setMaxItems: (@maxItems) -> selectPreviousItemView: -> view = @getSelectedItemView().prev() @@ -256,7 +256,7 @@ class SelectListView extends View # editor. # # Returns the property name to fuzzy filter by. - getFilterKey: -> return + getFilterKey: -> # Public: Focus the fuzzy filter editor view. focusFilterEditor: -> diff --git a/src/task-bootstrap.coffee b/src/task-bootstrap.coffee index 3eee1dda2..4ed618d1a 100644 --- a/src/task-bootstrap.coffee +++ b/src/task-bootstrap.coffee @@ -2,22 +2,22 @@ handler = null setupGlobals = -> - global.attachEvent = -> return + global.attachEvent = -> console = warn: -> emit 'task:warn', arguments... log: -> emit 'task:log', arguments... error: -> emit 'task:error', arguments... - trace: -> return + trace: -> global.__defineGetter__ 'console', -> console global.document = createElement: -> - setAttribute: -> return + setAttribute: -> getElementsByTagName: -> [] - appendChild: -> return + appendChild: -> documentElement: - insertBefore: -> return - removeChild: -> return + insertBefore: -> + removeChild: -> getElementById: -> {} createComment: -> {} createDocumentFragment: -> {} diff --git a/src/tokenized-buffer.coffee b/src/tokenized-buffer.coffee index a657150de..b227d57d7 100644 --- a/src/tokenized-buffer.coffee +++ b/src/tokenized-buffer.coffee @@ -90,7 +90,7 @@ class TokenizedBuffer extends Model # Specifies the tab length. # # tabLength - A {Number} that defines the new tab length. - setTabLength: (@tabLength) -> return + setTabLength: (@tabLength) -> setInvisibles: (invisibles) -> if invisibles isnt @invisibles