Unindent only if the tab is at the start of the line

This commit is contained in:
Ivan Zuzak
2014-06-11 18:31:37 +02:00
parent 4f77a371f4
commit 588d9b97eb

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]]