mirror of
https://github.com/atom/atom.git
synced 2026-02-09 14:15:24 -05:00
Editor handles backspace-to-beginning-of-word
This commit is contained in:
@@ -57,6 +57,9 @@ class CompositeSeleciton
|
||||
backspace: ->
|
||||
@modifySelectedText (selection) -> selection.backspace()
|
||||
|
||||
backspaceToBeginningOfWord: ->
|
||||
@modifySelectedText (selection) -> selection.backspaceToBeginningOfWord()
|
||||
|
||||
delete: ->
|
||||
@modifySelectedText (selection) -> selection.delete()
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@ class Editor extends View
|
||||
@on 'select-down', => @selectDown()
|
||||
@on 'newline', => @insertText("\n")
|
||||
@on 'backspace', => @backspace()
|
||||
@on 'backspace-to-beginning-of-word', => @backspaceToBeginningOfWord()
|
||||
@on 'delete', => @delete()
|
||||
@on 'cut', => @cutSelection()
|
||||
@on 'copy', => @copySelection()
|
||||
@@ -403,6 +404,9 @@ class Editor extends View
|
||||
selectToEndOfWord: -> @compositeSelection.selectToEndOfWord()
|
||||
selectToScreenPosition: (position) -> @compositeSelection.selectToScreenPosition(position)
|
||||
clearSelections: -> @compositeSelection.clearSelections()
|
||||
backspace: -> @compositeSelection.backspace()
|
||||
backspaceToBeginningOfWord: -> @compositeSelection.backspaceToBeginningOfWord()
|
||||
delete: -> @compositeSelection.delete()
|
||||
|
||||
setText: (text) -> @buffer.setText(text)
|
||||
getText: -> @buffer.getText()
|
||||
@@ -424,11 +428,6 @@ class Editor extends View
|
||||
|
||||
foldSelection: -> @getSelection().fold()
|
||||
|
||||
backspace: ->
|
||||
@compositeSelection.backspace()
|
||||
|
||||
delete: ->
|
||||
@compositeSelection.delete()
|
||||
|
||||
undo: ->
|
||||
@buffer.undo()
|
||||
|
||||
@@ -129,6 +129,10 @@ class Selection extends View
|
||||
@selectLeft() if @isEmpty()
|
||||
@deleteSelectedText()
|
||||
|
||||
backspaceToBeginningOfWord: ->
|
||||
@selectToBeginningOfWord() if @isEmpty()
|
||||
@deleteSelectedText()
|
||||
|
||||
delete: ->
|
||||
@selectRight() if @isEmpty()
|
||||
@deleteSelectedText()
|
||||
|
||||
Reference in New Issue
Block a user