From 29970acaa9355975ecabe2c6d72d740c9f43e93f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 23 Jul 2014 10:28:07 -0700 Subject: [PATCH] :memo: Document second argument of callback --- src/editor.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/editor.coffee b/src/editor.coffee index 870c14b6c..4531d4dce 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -1067,9 +1067,11 @@ class Editor extends Model # 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}. + # fn - A {Function} that will be called once for each {Selection}. The first + # argument will be a {Selection} and the second argument will be the + # {Number} index of that selection. mutateSelectedText: (fn) -> - @transact => fn(selection,index) for selection,index in @getSelections() + @transact => fn(selection, index) for selection, index in @getSelections() replaceSelectedText: (options={}, fn) -> {selectWordIfEmpty} = options