implemented auto-resize

as per recommended by codemirror