     else
       formatline = formattedformatline.join('|')
 
-    formatted.splice(formatrow, 0, [formatline])
+    formatted.splice(formatrow, 0, formatline)
     fmtstr = formatted.join('\n')+'\n'
     fmtstr = '\n'+fmtstr if headerline.length==0 and text[1]!=''
     return fmtstr


  formatTable: (text) ->
    just = (string, type, n) ->
      length = n - wcswidth(string)
      if type == '::'
        return ' '.repeat(length/2) + string + ' '.repeat((length+1)/2)
      else if type == '-:'

{CompositeDisposable,Range} = require('atom')
wcswidth = require 'wcwidth'

# DEBUG = true

swidth = (str) ->
  zwcrx = /[\u200B-\u200D\uFEFF\u00AD]/g
  wcswidth(str) - ( str.match(zwcrx)?.length or 0 )

module.exports =
class TableFormatter
