mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04: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()
|
||||
|
||||
Reference in New Issue
Block a user