         # console.log('myIterator')
         myIterator = (obj) =>
             # console.log('iterating')
-            obj.replace(@formatTable(obj.matchText))
+            obj.replace(@formatTable(obj.match))
 
         for range in selectionsRanges
             # console.log(@regex)

class TableFormatter
    subscriptions: []
    #regex: /((.+?)\|)+?(.+)?\r?\n(([:\-\|]+?)\|)+?([:\-\|]+)?[ ]*(\r?\n((.+?)\|)+?(.+)?)+/mg
    regex: /((.+?)\|)+?(.+)?\r?\n(([\s:\-\|]+?)\|)+?([\s:\-\|]+)?[ ]*(\r?\n((.+?)\|)+?(.+)?)+/mg

    constructor: ->
        atom.workspace.observeTextEditors (editor) =>


        formatted.splice(formatrow, 0, [formatline]);

        return formatted.join('\n')+'\n'

module.exports =
    config:
