fix bug that empty pre leaves when editing.
move the caret loggic to jquery.caret.js.
fix #108. scroll to target line after editting.