### Godot version

4.0 stable

### System information

Manjaro Linux, kernel 6.1.1-1-MANJARO, AMD Ryzen 5 3600, AMD RX 580

### Issue description

The `wrap_mode` property of the `TextEdit` node doesn't seem to really do anything. Setting it to `LINE_WRAPPING_BOUNDARY` simply means that there won't be an horizontal scrollbar if the text overshoots the boundary, instead of actually forcing the text to the next line so that it stays visible.

### Steps to reproduce

Create a TextEdit node and set its `wrap_mode` property to `LINE_WRAPPING_BOUNDARY`

### Minimal reproduction project

[WrapBugDemo.zip](https://github.com/godotengine/godot/files/10875969/WrapBugDemo.zip)

Ref<Font> font;
		int font_size = -1;
		int font_height = 0;
		String language;
		TextServer::Direction direction = TextServer::DIRECTION_AUTO;
		bool draw_control_chars = false;
		int line_height = -1;
		int max_width = -1;
		int width = -1;
		int tab_size = 4;
		int gutter_count = 0;
		void _calculate_line_height();
		void _calculate_max_line_width();
	public:
		void set_tab_size(int p_tab_size);
		int get_tab_size() const;
		void set_font(const Ref<Font> &p_font);
		void set_font_size(int p_font_size);
		void set_direction_and_language(TextServer::Direction p_direction, const String &p_language);
		void set_draw_control_chars(bool p_enabled);
		int get_line_height() const;
		int get_line_width(int p_line, int p_wrap_index = -1) const;
		int get_max_width() const;
		void set_width(float p_width);
		float get_width() const;
		int get_line_wrap_amount(int p_line) const;
		Vector<Vector2i> get_line_wrap_ranges(int p_line) const;
		const Ref<TextParagraph> get_line_data(int p_line) const;
		void set(int p_line, const String &p_text, const Array &p_bidi_override);
		void set_hidden(int p_line, bool p_hidden) {