### Godot version

4.1 dev4

### System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

### Issue description


https://github.com/godotengine/godot/assets/2223172/fe382ae2-04bb-4efa-b666-9e94ebb56a9c



### Steps to reproduce

1​. Go to Script Editor
2​. Toggle bookmark (Go To -> Toggle Bookmark)
3[.](https://media.tenor.com/_BiwWBWhYucAAAAd/what-huh.gif) It's not visible

### Minimal reproduction project

N/A
Vector<int> caret_edit_order = text_editor->get_caret_index_edit_order();
	caret_edit_order.reverse();
	int last_line = -1;
	for (const int &c : caret_edit_order) {
		int from = text_editor->has_selection(c) ? text_editor->get_selection_from_line(c) : text_editor->get_caret_line(c);
		from += from == last_line ? 1 : 0;
		int to = text_editor->has_selection(c) ? text_editor->get_selection_to_line(c) : text_editor->get_caret_line(c);
		if (to < from) {
			continue;
		}
		
		bool selection_has_bookmarks = false;
		for (int line = from; line <= to; line++) {
			if (text_editor->is_line_bookmarked(line)) {
				selection_has_bookmarks = true;
				break;
			}
		}
		
		if (!selection_has_bookmarks) {
			if (text_editor->get_caret_line(c) != last_line) {
				text_editor->set_line_as_bookmarked(text_editor->get_caret_line(c), true);
			}
		} else {
			for (int line = from; line <= to; line++) {
				text_editor->set_line_as_bookmarked(line, false);
			}
		}
		last_line = to;
	}