From ff188723cd03827546e33a05f5cbab3fc611e78d Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Mon, 15 Sep 2014 19:02:14 -0700 Subject: [PATCH] Create a saving section --- src/editor.coffee | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/editor.coffee b/src/editor.coffee index b2773af9d..f449cfa86 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -524,22 +524,6 @@ class Editor extends Model # Essential: Returns the {String} path of this editor's text buffer. getPath: -> @buffer.getPath() - # Essential: Saves the editor's text buffer. - # - # See {TextBuffer::save} for more details. - save: -> @buffer.save() - - # Essential: Saves the editor's text buffer as the given path. - # - # See {TextBuffer::saveAs} for more details. - # - # * `filePath` A {String} path. - saveAs: (filePath) -> @buffer.saveAs(filePath) - - # Extended: Determine whether the user should be prompted to save before closing - # this editor. - shouldPromptToSave: -> @isModified() and not @buffer.hasMultipleEditors() - # Essential: Returns {Boolean} `true` if this editor has been modified. isModified: -> @buffer.isModified() @@ -551,6 +535,26 @@ class Editor extends Model if filePath = @getPath() atom.clipboard.write(filePath) + ### + Section: Saving + ### + + # Essential: Saves the editor's text buffer. + # + # See {TextBuffer::save} for more details. + save: -> @buffer.save() + + # Extended: Saves the editor's text buffer as the given path. + # + # See {TextBuffer::saveAs} for more details. + # + # * `filePath` A {String} path. + saveAs: (filePath) -> @buffer.saveAs(filePath) + + # Extended: Determine whether the user should be prompted to save before closing + # this editor. + shouldPromptToSave: -> @isModified() and not @buffer.hasMultipleEditors() + ### Section: Reading Text ###