Make Editor::mutateSelectedText public

This commit is contained in:
Kevin Sawicki
2014-04-17 14:15:13 -07:00
parent ec0ec3bb16
commit 77641f138b

View File

@@ -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()