Fixed selection drawing, caret position, scroll

- selection drawing for 3+ lines
- caret position at the end of text
- "auto" scroll when keyboard cover caret
- code cleanup