mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
Hard tabs in snippets are translated to soft-tabs if necessary
This commit is contained in:
@@ -211,6 +211,10 @@ class EditSession
|
||||
autoIndentSelectedRows: ->
|
||||
@mutateSelectedText (selection) -> selection.autoIndentSelectedRows()
|
||||
|
||||
normalizeTabsInBufferRange: (bufferRange) ->
|
||||
return unless @softTabs
|
||||
@scanInRange /\t/, bufferRange, (match, range, {replace}) => replace(@getTabText())
|
||||
|
||||
cutToEndOfLine: ->
|
||||
maintainPasteboard = false
|
||||
@mutateSelectedText (selection) ->
|
||||
@@ -251,8 +255,9 @@ class EditSession
|
||||
undo: (editSession) ->
|
||||
editSession?.setSelectedBufferRanges(oldSelectedRanges)
|
||||
if fn
|
||||
fn()
|
||||
result = fn()
|
||||
@commit() if isNewTransaction
|
||||
result
|
||||
|
||||
commit: ->
|
||||
newSelectedRanges = @getSelectedBufferRanges()
|
||||
|
||||
@@ -185,6 +185,8 @@ class Selection
|
||||
else
|
||||
@editSession.autoDecreaseIndentForRow(newBufferRange.start.row)
|
||||
|
||||
newBufferRange
|
||||
|
||||
indent: ({ autoIndent }={})->
|
||||
{ row, column } = @cursor.getBufferPosition()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user