mirror of
https://github.com/atom/atom.git
synced 2026-02-15 17:15:24 -05:00
💄 Deprecate backspaceToBeginningOf{Word,Line}
Rename functions `backspaceToBeginningOfWord` to `deleteToBeginningOfWord` and `backspaceToBeginningOfLine to `deleteToBeginningOfLine`. Rename commands `editor:backspace-to-beginning-of-word` to `delete-to-beginning-of-word` and `editor:backspace-to-beginning-of-line` to `editor:delete-to-beginning-of-line`. Fix #1791
This commit is contained in:
@@ -382,15 +382,25 @@ class Selection extends Model
|
||||
@selectLeft() if @isEmpty() and not @editor.isFoldedAtScreenRow(@cursor.getScreenRow())
|
||||
@deleteSelectedText()
|
||||
|
||||
# Deprecated: Use {::deleteToBeginningOfWord} instead.
|
||||
backspaceToBeginningOfWord: ->
|
||||
deprecate("Use Selection::deleteToBeginningOfWord() instead")
|
||||
@deleteToBeginningOfWord()
|
||||
|
||||
# Deprecated: Use {::deleteToBeginningOfLine} instead.
|
||||
backspaceToBeginningOfLine: ->
|
||||
deprecate("Use Selection::deleteToBeginningOfLine() instead")
|
||||
@deleteToBeginningOfLine()
|
||||
|
||||
# Public: Removes from the start of the selection to the beginning of the
|
||||
# current word if the selection is empty otherwise it deletes the selection.
|
||||
backspaceToBeginningOfWord: ->
|
||||
deleteToBeginningOfWord: ->
|
||||
@selectToBeginningOfWord() if @isEmpty()
|
||||
@deleteSelectedText()
|
||||
|
||||
# Public: Removes from the beginning of the line which the selection begins on
|
||||
# all the way through to the end of the selection.
|
||||
backspaceToBeginningOfLine: ->
|
||||
deleteToBeginningOfLine: ->
|
||||
if @isEmpty() and @cursor.isAtBeginningOfLine()
|
||||
@selectLeft()
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user