This commit is contained in:
probablycorey
2013-04-01 09:47:24 -07:00
parent 32c950dee8
commit 875474d496
2 changed files with 3 additions and 3 deletions

View File

@@ -5,8 +5,8 @@ module.exports =
whitespaceBeforeSave: (buffer) ->
buffer.on 'will-be-saved', ->
buffer.transact ->
buffer.scan /[ \t]+$/g, (match, range, { replace }) ->
replace('')
buffer.scan /[ \t]+$/g, (match, range, { replace }) -> replace('')
if config.get('whitespace.singleTrailingNewline')
if buffer.getLastLine() is ''
row = buffer.getLastRow() - 1

View File

@@ -11,12 +11,12 @@ describe "Whitespace", ->
rootView.open(path)
atom.activatePackage('whitespace')
rootView.focus()
editor = rootView.getActiveView()
afterEach ->
fs.remove(path) if fs.exists(path)
rootView.remove()
it "strips trailing whitespace before an editor saves a buffer", ->
spyOn(fs, 'write')