From 5a944514f3a95c496d29018720154dddd109ccae Mon Sep 17 00:00:00 2001 From: Garen Torikian Date: Wed, 1 May 2013 16:53:20 -0700 Subject: [PATCH] Rewrite all hash key options --- src/app/buffer-marker.coffee | 12 ++++++------ src/app/cursor.coffee | 10 +++++----- src/app/display-buffer.coffee | 14 +++++++------- src/app/editor.coffee | 10 +++++----- src/app/git.coffee | 4 ++-- src/app/range.coffee | 4 ++-- src/app/selection.coffee | 10 +++++----- src/app/text-buffer.coffee | 12 ++++++------ 8 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/app/buffer-marker.coffee b/src/app/buffer-marker.coffee index 818f62fa3..80405d435 100644 --- a/src/app/buffer-marker.coffee +++ b/src/app/buffer-marker.coffee @@ -21,8 +21,8 @@ class BufferMarker # # range - The new {Range} the marker should cover # options - A hash of options with the following keys: - # :reverse - if `true`, the marker is reversed; that is, its tail is "above" the head - # :noTail - if `true`, the marker doesn't have a tail + # reverse: if `true`, the marker is reversed; that is, its tail is "above" the head + # noTail: if `true`, the marker doesn't have a tail setRange: (range, options={}) -> @consolidateObserverNotifications false, => range = Range.fromObject(range) @@ -70,8 +70,8 @@ class BufferMarker # # newHeadPosition - The new {Point} to place the head # options - A hash with the following keys: - # :clip - if `true`, the point is [clipped]{Buffer.clipPosition} - # :bufferChanged - if `true`, indicates that the {Buffer} should trigger an event that it's changed + # clip: if `true`, the point is [clipped]{Buffer.clipPosition} + # bufferChanged: if `true`, indicates that the {Buffer} should trigger an event that it's changed # # Returns a {Point} representing the new head position. setHeadPosition: (newHeadPosition, options={}) -> @@ -88,8 +88,8 @@ class BufferMarker # # newHeadPosition - The new {Point} to place the tail # options - A hash with the following keys: - # :clip - if `true`, the point is [clipped]{Buffer.clipPosition} - # :bufferChanged - if `true`, indicates that the {Buffer} should trigger an event that it's changed + # clip: if `true`, the point is [clipped]{Buffer.clipPosition} + # bufferChanged: if `true`, indicates that the {Buffer} should trigger an event that it's changed # # Returns a {Point} representing the new tail position. setTailPosition: (newTailPosition, options={}) -> diff --git a/src/app/cursor.coffee b/src/app/cursor.coffee index c79ca05c2..856af88ae 100644 --- a/src/app/cursor.coffee +++ b/src/app/cursor.coffee @@ -57,7 +57,7 @@ class Cursor # # screenPosition - An {Array} of two numbers: the screen row, and the screen column. # options - An object with the following keys: - # :autoscroll - A {Boolean} which, if `true`, scrolls the {EditSession} to wherever the cursor moves to + # autoscroll: A {Boolean} which, if `true`, scrolls the {EditSession} to wherever the cursor moves to # setScreenPosition: (screenPosition, options={}) -> @changePosition options, => @@ -73,7 +73,7 @@ class Cursor # # bufferPosition - An {Array} of two numbers: the buffer row, and the buffer column. # options - An object with the following keys: - # :autoscroll - A {Boolean} which, if `true`, scrolls the {EditSession} to wherever the cursor moves to + # autoscroll: A {Boolean} which, if `true`, scrolls the {EditSession} to wherever the cursor moves to # setBufferPosition: (bufferPosition, options={}) -> @changePosition options, => @@ -247,7 +247,7 @@ class Cursor # Retrieves the buffer position of where the current word starts. # # options - A hash with one option: - # :wordRegex - A {RegExp} indicating what constitutes a "word" (default: {wordRegExp}) + # wordRegex: A {RegExp} indicating what constitutes a "word" (default: {wordRegExp}) # # Returns a {Range}. getBeginningOfCurrentWordBufferPosition: (options = {}) -> @@ -268,7 +268,7 @@ class Cursor # Retrieves the buffer position of where the current word ends. # # options - A hash with one option: - # :wordRegex - A {RegExp} indicating what constitutes a "word" (default: {wordRegExp}) + # wordRegex: A {RegExp} indicating what constitutes a "word" (default: {wordRegExp}) # # Returns a {Range}. getEndOfCurrentWordBufferPosition: (options = {}) -> @@ -288,7 +288,7 @@ class Cursor # Retrieves the buffer position of where the next word starts. # # options - A hash with one option: - # :wordRegex - A {RegExp} indicating what constitutes a "word" (default: {wordRegExp}) + # wordRegex: A {RegExp} indicating what constitutes a "word" (default: {wordRegExp}) # # Returns a {Range}. getBeginningOfNextWordBufferPosition: (options = {}) -> diff --git a/src/app/display-buffer.coffee b/src/app/display-buffer.coffee index 3c6d84b5a..8c5178306 100644 --- a/src/app/display-buffer.coffee +++ b/src/app/display-buffer.coffee @@ -259,8 +259,8 @@ class DisplayBuffer # bufferPosition - An object that represents a buffer position. It can be either # an {Object} (`{row, column}`), {Array} (`[row, column]`), or {Point} # options - A hash of options with the following keys: - # :wrapBeyondNewlines - - # :wrapAtSoftNewlines - + # wrapBeyondNewlines: + # wrapAtSoftNewlines: # # Returns a {Point}. screenPositionForBufferPosition: (position, options) -> @@ -271,8 +271,8 @@ class DisplayBuffer # screenPosition - An object that represents a buffer position. It can be either # an {Object} (`{row, column}`), {Array} (`[row, column]`), or {Point} # options - A hash of options with the following keys: - # :wrapBeyondNewlines - - # :wrapAtSoftNewlines - + # wrapBeyondNewlines: + # wrapAtSoftNewlines: # # Returns a {Point}. bufferPositionForScreenPosition: (position, options) -> @@ -323,9 +323,9 @@ class DisplayBuffer # # position - The {Point} to clip # options - A hash with the following values: - # :wrapBeyondNewlines - if `true`, continues wrapping past newlines - # :wrapAtSoftNewlines - if `true`, continues wrapping past soft newlines - # :screenLine - if `true`, indicates that you're using a line number, not a row number + # wrapBeyondNewlines: if `true`, continues wrapping past newlines + # wrapAtSoftNewlines: if `true`, continues wrapping past soft newlines + # screenLine: if `true`, indicates that you're using a line number, not a row number # # Returns the new, clipped {Point}. Note that this could be the same as `position` if no clipping was performed. clipScreenPosition: (position, options) -> diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 177d3c390..4d944e39e 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -529,10 +529,10 @@ class Editor extends View # Defines which characters are invisible. # # invisibles - A hash defining the invisible characters: The defaults are: - # :eol - `\u00ac` - # :space - `\u00b7` - # :tab - `\u00bb` - # :cr - `\u00a4` + # eol: `\u00ac` + # space: `\u00b7` + # tab: `\u00bb` + # cr: `\u00a4` setInvisibles: (@invisibles={}) -> _.defaults @invisibles, eol: '\u00ac' @@ -813,7 +813,7 @@ class Editor extends View # pixelPosition - An object that represents a pixel position. It can be either # an {Object} (`{row, column}`), {Array} (`[row, column]`), or {Point} # options - A hash with the following keys: - # :center - if `true`, the position is scrolled such that it's in the center of the editor + # center: if `true`, the position is scrolled such that it's in the center of the editor scrollToPixelPosition: (pixelPosition, options) -> return unless @attached @scrollVertically(pixelPosition, options) diff --git a/src/app/git.coffee b/src/app/git.coffee index d77fdc68b..91fade3a0 100644 --- a/src/app/git.coffee +++ b/src/app/git.coffee @@ -21,7 +21,7 @@ class Git # # path - The {String} representing the path to your git working directory # options - A hash with the following keys: - # :refreshOnWindowFocus - If `true`, {#refreshIndex} and {#refreshStatus} are called on focus + # refreshOnWindowFocus: If `true`, {#refreshIndex} and {#refreshStatus} are called on focus constructor: (path, options={}) -> @repo = GitUtils.open(path) unless @repo? @@ -62,7 +62,7 @@ class Git # # path - The git repository to open # options - A hash with one key: - # :refreshOnWindowFocus - A {Boolean} that identifies if the windows should refresh + # refreshOnWindowFocus: A {Boolean} that identifies if the windows should refresh # # Returns a new {Git} object. @open: (path, options) -> diff --git a/src/app/range.coffee b/src/app/range.coffee index 834eb4e85..5be4519c4 100644 --- a/src/app/range.coffee +++ b/src/app/range.coffee @@ -122,7 +122,7 @@ class Range # # otherRange - A different {Range} to check against # options - A hash with a single option: - # :exclusive - A {Boolean} which, if `true`, indicates that no {Point}s in the `Range` can be equal + # exclusive: A {Boolean} which, if `true`, indicates that no {Point}s in the `Range` can be equal # # Returns a {Boolean}. containsRange: (otherRange, {exclusive} = {}) -> @@ -133,7 +133,7 @@ class Range # # point - A {Point} to check against # options - A hash with a single option: - # :exclusive - A {Boolean} which, if `true`, indicates that no {Point}s in the `Range` can be equal + # exclusive: A {Boolean} which, if `true`, indicates that no {Point}s in the `Range` can be equal # # Returns a {Boolean}. containsPoint: (point, {exclusive} = {}) -> diff --git a/src/app/selection.coffee b/src/app/selection.coffee index 36f172503..04f38381a 100644 --- a/src/app/selection.coffee +++ b/src/app/selection.coffee @@ -83,8 +83,8 @@ class Selection # # screenRange - The new {Range} to select # options - A hash of options with the following keys: - # :preserveFolds - if `true`, the fold settings are preserved after the selection moves - # :autoscroll - if `true`, the {EditSession} scrolls to the new selection + # preserveFolds: if `true`, the fold settings are preserved after the selection moves + # autoscroll: if `true`, the {EditSession} scrolls to the new selection setBufferRange: (bufferRange, options={}) -> bufferRange = Range.fromObject(bufferRange) @needsAutoscroll = options.autoscroll @@ -254,9 +254,9 @@ class Selection # # text - A {String} representing the text to add # options - A hash containing the following options: - # :normalizeIndent - TODO - # :select - if `true`, selects the newly added text - # :autoIndent - if `true`, indents the newly added text appropriately + # normalizeIndent: TODO + # select: if `true`, selects the newly added text + # autoIndent: if `true`, indents the newly added text appropriately insertText: (text, options={}) -> oldBufferRange = @getBufferRange() @editSession.destroyFoldsContainingBufferRow(oldBufferRange.end.row) diff --git a/src/app/text-buffer.coffee b/src/app/text-buffer.coffee index 7d12dbaa8..9e030c63f 100644 --- a/src/app/text-buffer.coffee +++ b/src/app/text-buffer.coffee @@ -464,8 +464,8 @@ class Buffer # id - A {Number} representing the marker to change # position - The new {Point} to place the head # options - A hash with the following keys: - # :clip - if `true`, the point is [clipped]{Buffer.clipPosition} - # :bufferChanged - if `true`, indicates that the {Buffer} should trigger an event that it's changed + # clip: if `true`, the point is [clipped]{Buffer.clipPosition} + # bufferChanged: if `true`, indicates that the {Buffer} should trigger an event that it's changed # # Returns a {Point} representing the new head position. setMarkerHeadPosition: (id, position, options) -> @@ -484,8 +484,8 @@ class Buffer # id - A {Number} representing the marker to change # position - The new {Point} to place the tail # options - A hash with the following keys: - # :clip - if `true`, the point is [clipped]{Buffer.clipPosition} - # :bufferChanged - if `true`, indicates that the {Buffer} should trigger an event that it's changed + # clip: if `true`, the point is [clipped]{Buffer.clipPosition} + # bufferChanged: if `true`, indicates that the {Buffer} should trigger an event that it's changed # # Returns a {Point} representing the new tail position. setMarkerTailPosition: (id, position, options) -> @@ -504,8 +504,8 @@ class Buffer # id - A {Number} representing the marker to change # range - The new {Range} the marker should cover # options - A hash of options with the following keys: - # :reverse - if `true`, the marker is reversed; that is, its tail is "above" the head - # :noTail - if `true`, the marker doesn't have a tail + # reverse: if `true`, the marker is reversed; that is, its tail is "above" the head + # noTail: if `true`, the marker doesn't have a tail setMarkerRange: (id, range, options) -> @validMarkers[id]?.setRange(range, options)