Merge pull request #8828 from atom/iz-cut-to-end-of-buffer-line

Add command for cutting text to the end of the cursor's buffer line
This commit is contained in:
Ivan Žužak
2015-09-20 10:45:45 +02:00
4 changed files with 49 additions and 3 deletions

View File

@@ -2665,7 +2665,7 @@ class TextEditor extends Model
@emitter.emit 'did-insert-text', didInsertEvent
# Essential: For each selection, if the selection is empty, cut all characters
# of the containing line following the cursor. Otherwise cut the selected
# of the containing screen line following the cursor. Otherwise cut the selected
# text.
cutToEndOfLine: ->
maintainClipboard = false
@@ -2673,6 +2673,15 @@ class TextEditor extends Model
selection.cutToEndOfLine(maintainClipboard)
maintainClipboard = true
# Essential: For each selection, if the selection is empty, cut all characters
# of the containing buffer line following the cursor. Otherwise cut the
# selected text.
cutToEndOfBufferLine: ->
maintainClipboard = false
@mutateSelectedText (selection) ->
selection.cutToEndOfBufferLine(maintainClipboard)
maintainClipboard = true
###
Section: Folds
###