Merge pull request #2584 from atom/iz-fix-tab-unindent

Outdent only if a tab is matched at the start of the line
This commit is contained in:
Ivan Žužak
2014-06-12 17:39:23 +02:00
2 changed files with 10 additions and 1 deletions

View File

@@ -495,7 +495,7 @@ class Selection extends Model
outdentSelectedRows: ->
[start, end] = @getBufferRowRange()
buffer = @editor.buffer
leadingTabRegex = new RegExp("^ {1,#{@editor.getTabLength()}}|\t")
leadingTabRegex = new RegExp("^( {1,#{@editor.getTabLength()}}|\t)")
for row in [start..end]
if matchLength = buffer.lineForRow(row).match(leadingTabRegex)?[0].length
buffer.delete [[row, 0], [row, matchLength]]