Comments. Change up the api a tiny bit.

This commit is contained in:
Ben Ogle
2013-11-08 12:25:59 -08:00
parent ddd560b785
commit ee896846bb
2 changed files with 16 additions and 3 deletions

View File

@@ -538,7 +538,13 @@ class TextBuffer
result.lineTextOffset = 0
iterator(result)
replace: (regex, replacementText, iterator) ->
# Replace all matches of regex with replacementText
#
# regex: A {RegExp} representing the text to find
# replacementText: A {String} representing the text to replace
#
# Returns the number of replacements made
replace: (regex, replacementText) ->
doSave = !@isModified()
replacements = 0
@@ -549,7 +555,7 @@ class TextBuffer
@save() if doSave
iterator({filePath: @getPath(), replacements})
replacements
# Scans for text in a given range, calling a function on each match.
#