mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
💄
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user