mirror of
https://github.com/atom/atom.git
synced 2026-02-17 01:51:54 -05:00
Rewrite all hash key options
This commit is contained in:
@@ -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={}) ->
|
||||
|
||||
@@ -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 = {}) ->
|
||||
|
||||
@@ -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) ->
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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) ->
|
||||
|
||||
@@ -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} = {}) ->
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user