mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Merge pull request #1878 from atom/ks-mutate-selected-text-public
Make Editor::mutateSelectedText public
This commit is contained in:
@@ -1002,6 +1002,12 @@ 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} that will be called with each {Selection}.
|
||||
mutateSelectedText: (fn) ->
|
||||
@transact => fn(selection) for selection in @getSelections()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user