         @$pad.val(text_state[0])
         @$pad[0].selectionEnd = text_state[1][0]
         @$pad[0].selectionStart = text_state[1][1]
+        print "set scrollTop", text_state[2]
+        @$holder.animate(scrollTop: text_state[2])
         @update()
 
     get_text_state: () ->
         text_state = [
             @$pad.val(),
             [@$pad[0].selectionEnd, @$pad[0].selectionStart],
-            scroll
+            @$holder.scrollTop(),
         ]
+        print "get scrollTop", @$holder.scrollTop()
         return text_state
 
     show_promt: (p) ->

            @$pad[0].selectionEnd = @$pad[0].selectionStart
        else
            @$pad[0].selectionStart = @lines[start][1]

            @$pad[0].selectionEnd = @$pad[0].selectionStart + new_length



    set_text: (text) ->
        @$pad.val(text)

            if @keymap[key]?
                print @keymap[key]
                @keymap[key]()
                e.stopPropagation()
                e.preventDefault()
                return null
