 
     # works for buffers that are already open when extension is initialized
     editor.insertText("foo   \nbar\t   \n\nbaz")
-    editor.getBuffer().save()
+    editor.save()
     expect(editor.getText()).toBe "foo\nbar\n\nbaz"
 
     # works for buffers that are opened after extension is initialized

      spyOn(fsUtils, 'write')
      config.set("whitespace.ensureSingleTrailingNewline", false)

      buffer = editor.getBuffer()
      buffer.retain()
      editor.destroy()


    it "trims GFM text with a single space", ->
      editor.setGrammar(grammar)
      editor.insertText "foo \nline break!"
      editor.save()
      expect(editor.getText()).toBe "foo\nline break!\n"

    it "leaves GFM text with double spaces alone", ->
      editor.setGrammar(grammar)
      editor.insertText "foo  \nline break!"
      editor.save()
      expect(editor.getText()).toBe "foo  \nline break!\n"

    it "trims GFM text with a more than two spaces", ->
      editor.setGrammar(grammar)
      editor.insertText "foo   \nline break!"
      editor.save()
      expect(editor.getText()).toBe "foo\nline break!\n"
