Skip to content

Commit

Permalink
Updated to get rid of deprecated use of undo: 'skip' (#4)
Browse files Browse the repository at this point in the history
Fixes #3
  • Loading branch information
Doug Watkins authored and sompylasar committed Aug 8, 2018
1 parent 596cc09 commit 02d9bba
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 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,7 +92,8 @@ removeTrailingWhitespace = (editor, lineInfo, keepColumn = 0) ->
trailingWhitespaceBufferRange = new Range(currLineEndNoWhitespaceBufferPos, lineInfo.end.bufferPos)
trailingWhitespaceBufferText = editor.getTextInBufferRange(trailingWhitespaceBufferRange)
if (trailingWhitespaceBufferText != '')
editor.setTextInBufferRange(trailingWhitespaceBufferRange, '', { undo: 'skip' })
editor.setTextInBufferRange(trailingWhitespaceBufferRange, '')
editor.groupLastChanges()
return true
return

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

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

Expand Down

0 comments on commit 02d9bba

Please sign in to comment.