From 77641f138b92d975a5d58e430153c2ec2d639d0d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 17 Apr 2014 14:15:13 -0700 Subject: [PATCH 1/2] Make Editor::mutateSelectedText public --- src/editor.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/editor.coffee b/src/editor.coffee index d286e187f..58ed352d1 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -1002,6 +1002,13 @@ class Editor extends Model deprecate("Use Editor::duplicateLines() instead") @duplicateLines() + # Public: Mutate the text of all the selections in a single transaction. + # + # All the changes made inside the given {Function} can be reverted with a + # single call to {::undo}. + # + # fn - A {Function} to call once per selection with the {Selection} as the + # first argument. mutateSelectedText: (fn) -> @transact => fn(selection) for selection in @getSelections() From 0c01de350d3b9f3b71e1aefacbbe228e98fdef33 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 17 Apr 2014 18:23:34 -0700 Subject: [PATCH 2/2] :memo: Shorten and tweak comment --- src/editor.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/editor.coffee b/src/editor.coffee index 58ed352d1..c5b83ef67 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -1007,8 +1007,7 @@ class Editor extends Model # All the changes made inside the given {Function} can be reverted with a # single call to {::undo}. # - # fn - A {Function} to call once per selection with the {Selection} as the - # first argument. + # fn - A {Function} that will be called with each {Selection}. mutateSelectedText: (fn) -> @transact => fn(selection) for selection in @getSelections()