### Godot version

Godot 4.0 statble

### System information

Windows 10

### Issue description

TextEdit boundary wrapmode not works, it only removes the horizontal scrollbar

### Steps to reproduce

Add a textedit in editor, set  the wrap mode to boundary, type something.

### Minimal reproduction project

![image](https://user-images.githubusercontent.com/9168814/224538077-2efb4e67-8976-496e-9223-c460365ecc28.png)
![image](https://user-images.githubusercontent.com/9168814/224538084-af773b86-d73a-4e8b-9b66-a0fb4bde1168.png)

undo_stack_pos = undo_stack_pos->next();
			op = undo_stack_pos->get();
			_do_text_op(op, false);
			current_op.version = op.version;
			if (undo_stack_pos->get().chain_backward) {
				break;
			}
		}
	}
	_update_scrollbars();
	bool dirty_carets = carets.size() != undo_stack_pos->get().end_carets.size();
	if (!dirty_carets) {
		for (int i = 0; i < carets.size(); i++) {
			if (carets[i].line != undo_stack_pos->get().end_carets[i].line || carets[i].column != undo_stack_pos->get().end_carets[i].column) {
				dirty_carets = true;
				break;
			}
		}
	}
	carets = undo_stack_pos->get().end_carets;
	undo_stack_pos = undo_stack_pos->next();
	if (dirty_carets && !caret_pos_dirty) {
		if (is_inside_tree()) {
			MessageQueue::get_singleton()->push_call(this, "_emit_caret_changed");
		}
		caret_pos_dirty = true;
	}
	adjust_viewport_to_caret();
}
void TextEdit::clear_undo_history() {