updated docstring

This commit is contained in:
Allen Nelson
2014-06-17 12:18:34 -05:00
parent 8411d41621
commit ef7f0ed9ed
2 changed files with 8 additions and 8 deletions

View File

@@ -690,10 +690,10 @@ class Editor extends Model
delete: ->
@mutateSelectedText (selection) -> selection.delete()
# Public: For each selection, if the selection is empty, delete all characters
# of the containing line following the cursor, or if the cursor is at the end
# of the line, delete the following newline. If not empty, delete the
# selected text.
# Public: For each selection, if the selection is not empty, deletes the
# selection; otherwise, deletes all characters of the containing line
# following the cursor. If the cursor is already at the end of the line,
# deletes the following newline.
deleteToEndOfLine: ->
@mutateSelectedText (selection) -> selection.deleteToEndOfLine()

View File

@@ -430,10 +430,10 @@ class Selection extends Model
@selectRight()
@deleteSelectedText()
# Public: If nothing selected, removes all characters from cursor
# until the end of the current line, unless already at the end of
# the line, in which case removes the following newline.
# If there is a selection, deletes only the selection.
# Public: If the selection is empty, removes all text from the cursor to the
# end of the line. If the cursor is already at the end of the line, it
# removes the following newline. If the selection isn't empty, only deletes
# the contents of the selection.
deleteToEndOfLine: ->
return @delete() if @isEmpty() and @cursor.isAtEndOfLine()
@selectToEndOfLine() if @isEmpty()