fixed some bugs with cursor, newlines, hidden paragraphs and tables