mirror of
https://github.com/atom/atom.git
synced 2026-02-09 22:24:59 -05:00
Merge branch 'master' of github.com:github/atom
This commit is contained in:
@@ -158,7 +158,7 @@ class Buffer
|
||||
|
||||
if matchEndIndex > endIndex
|
||||
regex.lastIndex = 0
|
||||
if matchStartIndex < endIndex and match = regex.exec(text[matchStartIndex..endIndex])
|
||||
if matchStartIndex < endIndex and match = regex.exec(text[matchStartIndex...endIndex])
|
||||
matchLength = match[0].length
|
||||
matchEndIndex = matchStartIndex + matchLength
|
||||
else
|
||||
|
||||
@@ -95,6 +95,14 @@ class CompositeSeleciton
|
||||
selection.selectToEndOfLine() for selection in @getSelections()
|
||||
@mergeIntersectingSelections()
|
||||
|
||||
selectToBeginningOfWord: ->
|
||||
selection.selectToBeginningOfWord() for selection in @getSelections()
|
||||
@mergeIntersectingSelections reverse: true
|
||||
|
||||
selectToEndOfWord: ->
|
||||
selection.selectToEndOfWord() for selection in @getSelections()
|
||||
@mergeIntersectingSelections()
|
||||
|
||||
setBufferRange: (bufferRange, options) ->
|
||||
@getLastSelection().setBufferRange(bufferRange, options)
|
||||
|
||||
|
||||
@@ -116,6 +116,8 @@ class Editor extends View
|
||||
@on 'select-to-bottom', => @selectToBottom()
|
||||
@on 'select-to-end-of-line', => @selectToEndOfLine()
|
||||
@on 'select-to-beginning-of-line', => @selectToBeginningOfLine()
|
||||
@on 'select-to-end-of-word', => @selectToEndOfWord()
|
||||
@on 'select-to-beginning-of-word', => @selectToBeginningOfWord()
|
||||
|
||||
buildCursorAndSelection: ->
|
||||
@compositeSelection = new CompositeSelection(this)
|
||||
@@ -395,8 +397,10 @@ class Editor extends View
|
||||
selectDown: -> @compositeSelection.selectDown()
|
||||
selectToTop: -> @compositeSelection.selectToTop()
|
||||
selectToBottom: -> @compositeSelection.selectToBottom()
|
||||
selectToEndOfLine: -> @compositeSelection.selectToEndOfLine()
|
||||
selectToBeginningOfLine: -> @compositeSelection.selectToBeginningOfLine()
|
||||
selectToEndOfLine: -> @compositeSelection.selectToEndOfLine()
|
||||
selectToBeginningOfWord: -> @compositeSelection.selectToBeginningOfWord()
|
||||
selectToEndOfWord: -> @compositeSelection.selectToEndOfWord()
|
||||
selectToScreenPosition: (position) -> @compositeSelection.selectToScreenPosition(position)
|
||||
clearSelections: -> @compositeSelection.clearSelections()
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
window.keymap.bindKeys '.editor'
|
||||
'meta-up': 'move-to-top'
|
||||
'meta-shift-up': 'select-to-top'
|
||||
'meta-down': 'move-to-bottom'
|
||||
'meta-shift-down': 'select-to-bottom'
|
||||
'meta-right': 'move-to-end-of-line'
|
||||
'meta-left': 'move-to-beginning-of-line'
|
||||
'alt-left': 'move-to-beginning-of-word'
|
||||
'alt-right': 'move-to-end-of-word'
|
||||
'alt-right': 'move-to-end-of-word'
|
||||
'meta-shift-up': 'select-to-top'
|
||||
'meta-shift-down': 'select-to-bottom'
|
||||
'meta-shift-left': 'select-to-beginning-of-line'
|
||||
'meta-shift-right': 'select-to-end-of-line'
|
||||
'alt-shift-left': 'select-to-beginning-of-word'
|
||||
'alt-shift-right': 'select-to-end-of-word'
|
||||
@@ -236,6 +236,14 @@ class Selection extends View
|
||||
@modifySelection =>
|
||||
@cursor.moveToEndOfLine()
|
||||
|
||||
selectToBeginningOfWord: ->
|
||||
@modifySelection =>
|
||||
@cursor.moveToBeginningOfWord()
|
||||
|
||||
selectToEndOfWord: ->
|
||||
@modifySelection =>
|
||||
@cursor.moveToEndOfWord()
|
||||
|
||||
cut: (maintainPasteboard=false) ->
|
||||
@copy(maintainPasteboard)
|
||||
@delete()
|
||||
|
||||
Reference in New Issue
Block a user