this doesn't work if editor have folds or wrapped lines.