         @buffer.setText txt
 
   init: ($atomEmulator) ->
-    $textArea = $atomEmulator.find 'textarea'
-    atom.workspace.editor.buffer.$textArea = $textArea
-    $textArea.attr 'spellcheck', false
-    $textArea.keydown @keyHandler.bind this
+    $editableDiv = $atomEmulator.find '.edit-buffer'
+    atom.workspace.editor.buffer = new Buffer($editableDiv)
+    $editableDiv.attr 'spellcheck', false
+    $editableDiv.keydown @keyHandler.bind this
+    $editableDiv.focus()
+    # document.execCommand 'insertText', false, '[ 111\n, 222\n, 333\n]'
     setTimeout ( ->
       atom.notifications.addSuccess 'Atom emulator initialized'
     ), 300 # Small delay to see it appear after page has loaded

    if event.altKey and !event.shiftKey and event.metaKey and !event.ctrlKey or event.ctrlKey and !event.metaKey
      switch event.keyCode
        when 83
          atom.commands.dispatch(null, 'list-edit:select')
        when 88
          atom.commands.dispatch(null, 'list-edit:cut')

  # Note: does note handle column position past line end (returned ix is on following lines)
  characterIndexForPosition: (pos) ->
    pos = Point.fromObj(pos)
    bufferText = @getText()
    ix = 0
    row = pos.row
    col = pos.column
