Skip to content

Commit

Permalink
Revert "Updated to get rid of deprecated use of undo: 'skip' (#4)"
Browse files Browse the repository at this point in the history
This reverts commit 02d9bba.
  • Loading branch information
sompylasar committed Aug 8, 2018
1 parent eb2feb4 commit 4ceb31c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lib/atom-cursor-indent.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ ALL_WHITESPACE_REGEXP = /^\s*$/
debugLog = (name) ->
if (isDebug)
console.log.apply(console, [ 'atom-cursor-indent:' + name ].concat( [].slice.call(arguments, 1) ))


nextTick = () ->
return new Promise((resolve) ->
process.nextTick(resolve)
Expand Down Expand Up @@ -92,8 +92,7 @@ removeTrailingWhitespace = (editor, lineInfo, keepColumn = 0) ->
trailingWhitespaceBufferRange = new Range(currLineEndNoWhitespaceBufferPos, lineInfo.end.bufferPos)
trailingWhitespaceBufferText = editor.getTextInBufferRange(trailingWhitespaceBufferRange)
if (trailingWhitespaceBufferText != '')
editor.setTextInBufferRange(trailingWhitespaceBufferRange, '')
editor.groupLastChanges()
editor.setTextInBufferRange(trailingWhitespaceBufferRange, '', { undo: 'skip' })
return true
return

Expand All @@ -105,8 +104,7 @@ removeIndentWhitespace = (editor, lineInfo) ->
lineBufferRange = new Range(lineInfo.start.bufferPos, lineInfo.end.bufferPos)
lineBufferText = lineInfo.bufferText
if (lineBufferText != '')
editor.setTextInBufferRange(lineBufferRange, '')
editor.groupLastChanges()
editor.setTextInBufferRange(lineBufferRange, '', { undo: 'skip' })
return true
return

Expand All @@ -121,8 +119,7 @@ setIndentationForBufferRowWithoutUndo = (editor, bufferRow, newLevel) ->
nextIndentString: nextIndentString,
})
prevIndentBufferRange = [[bufferRow, 0], [bufferRow, prevIndentString.length]]
editor.setTextInBufferRange(prevIndentBufferRange, nextIndentString)
editor.groupLastChanges()
editor.setTextInBufferRange(prevIndentBufferRange, nextIndentString, { undo: 'skip' })
return true
return

Expand Down

0 comments on commit 4ceb31c

Please sign in to comment.