 
   indentScopedLanguages: ['python', 'coffee']
   # FIXME: why go dont' fold closing '}' for function? this is dirty workaround.
-  omitingClosingCharLanguages: ['go']
+  omittingClosingCharLanguages: ['go']
 
   initialize: ->
     @language = @editor.getGrammar().scopeName.replace(/^source\./, '')

  adjustRowRange: (startRow, endRow) ->
    if @isInner()
      startRow += 1
      unless @language in @indentScopedLanguages
        endRow -= 1
    endRow += 1 if (@language in @omitingClosingCharLanguages)
    [startRow, endRow]

class AFunction extends Function

        stop()
    found

  findOpenPair: (pair, options) ->
    options.which = 'open'
    options.allowNextLine ?= @allowNextLine
    @findPair(pair, options)

  findClosePair: (pair, options) ->
    options.which = 'close'
    options.allowNextLine ?= @allowNextLine
    @findPair(pair, options)

  getPairRange: (from, pair, what) ->
    range = null
    switch what
      when 'enclosed'
        open = @findOpenPair pair, {from: from, nest: 1}
        close = @findClosePair pair, {from: open, nest: 1} if open?
      when 'next'
        close = @findClosePair pair, {from: from, nest: 0}
        open = @findOpenPair pair, {from: close, nest: 1} if close?
      when 'previous' # FIXME but currently unused
        open  = @findOpenPair pair, {from: from,  nest: 0}
        close = @findClosePair pair, {from: open, nest: 1} if open?
    if open? and close?
      range = new Range(open, close)
      range = range.translate([0, -1], [0, 1]) unless @isInner()
    range
