📝 overlay decoration options in TextEditor::decorateMarker

This commit is contained in:
Nathan Sobo
2014-11-26 15:14:56 -07:00
parent 41b3d65e05
commit e2813b4dd9

View File

@@ -1263,18 +1263,33 @@ class TextEditor extends Model
# ## Arguments
#
# * `marker` A {Marker} you want this decoration to follow.
# * `decorationParams` An {Object} representing the decoration e.g. `{type: 'gutter', class: 'linter-error'}`
# * `type` There are a few supported decoration types: `gutter`, `line`, and `highlight`
# * `decorationParams` An {Object} representing the decoration e.g.
# `{type: 'gutter', class: 'linter-error'}`
# * `type` There are a few supported decoration types: `gutter`, `line`,
# `highlight`, and `overlay`. The behavior of the types are as follows:
# * `gutter` Adds the given `class` to the line numbers overlapping the
# rows spanned by the marker.
# * `line` Adds the given `class` to the lines overlapping the rows
# spanned by the marker.
# * `highlight` Creates a `.highlight` div with the nested class with up
# to 3 nested regions that fill the area spanned by the marker.
# * `overlay` Positions the view associated with the given item at the
# head or tail of the given marker, depending on the `position`
# property.
# * `class` This CSS class will be applied to the decorated line number,
# line, or highlight.
# * `onlyHead` (optional) If `true`, the decoration will only be applied to the head
# of the marker. Only applicable to the `line` and `gutter` types.
# * `onlyEmpty` (optional) If `true`, the decoration will only be applied if the
# associated marker is empty. Only applicable to the `line` and
# * `onlyHead` (optional) If `true`, the decoration will only be applied to
# the head of the marker. Only applicable to the `line` and `gutter`
# types.
# * `onlyEmpty` (optional) If `true`, the decoration will only be applied if
# the associated marker is empty. Only applicable to the `line` and
# `gutter` types.
# * `onlyNonEmpty` (optional) If `true`, the decoration will only be applied if the
# associated marker is non-empty. Only applicable to the `line` and
# gutter types.
# * `onlyNonEmpty` (optional) If `true`, the decoration will only be applied
# if the associated marker is non-empty. Only applicable to the `line`
# and gutter types.
# * `position` (optional) Only applicable to decorations of type `overlay`,
# controls where the overlay view is positioned relative to the marker.
# Values can be `'head'` (the default), or `'tail'`.
#
# Returns a {Decoration} object
decorateMarker: (marker, decorationParams) ->