mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
default singleTrailingNewline to true
This commit is contained in:
@@ -2,6 +2,9 @@ module.exports =
|
||||
activate: ->
|
||||
rootView.eachBuffer (buffer) => @whitespaceBeforeSave(buffer)
|
||||
|
||||
configDefaults:
|
||||
singleTrailingNewline: true
|
||||
|
||||
whitespaceBeforeSave: (buffer) ->
|
||||
buffer.on 'will-be-saved', ->
|
||||
buffer.transact ->
|
||||
|
||||
@@ -21,6 +21,9 @@ describe "Whitespace", ->
|
||||
it "strips trailing whitespace before an editor saves a buffer", ->
|
||||
spyOn(fs, 'write')
|
||||
|
||||
config.set("whitespace.ensureSingleTrailingNewline", false)
|
||||
config.update()
|
||||
|
||||
# works for buffers that are already open when extension is initialized
|
||||
editor.insertText("foo \nbar\t \n\nbaz")
|
||||
editor.getBuffer().save()
|
||||
|
||||
Reference in New Issue
Block a user