mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
When there is a selection, tab/shift-tab indent/outdent selected text
This commit is contained in:
@@ -502,10 +502,13 @@ class Editor extends View
|
||||
@insertText('\n')
|
||||
|
||||
insertTab: ->
|
||||
if @softTabs
|
||||
@compositeSelection.insertText(@tabText)
|
||||
if @getSelection().isEmpty()
|
||||
if @softTabs
|
||||
@compositeSelection.insertText(@tabText)
|
||||
else
|
||||
@compositeSelection.insertText('\t')
|
||||
else
|
||||
@compositeSelection.insertText('\t')
|
||||
@compositeSelection.indentSelectedRows()
|
||||
|
||||
indentSelectedRows: -> @compositeSelection.indentSelectedRows()
|
||||
outdentSelectedRows: -> @compositeSelection.outdentSelectedRows()
|
||||
|
||||
@@ -29,6 +29,7 @@ window.keymap.bindKeys '.editor',
|
||||
'alt-meta-right': 'split-right'
|
||||
'alt-meta-up': 'split-up'
|
||||
'alt-meta-down': 'split-down'
|
||||
'shift-tab': 'outdent-selected-rows'
|
||||
'meta-[': 'outdent-selected-rows'
|
||||
'meta-]': 'indent-selected-rows'
|
||||
'meta-{': 'show-previous-buffer'
|
||||
|
||||
Reference in New Issue
Block a user