### Godot version

4.0.2

### System information

Windows 11

### Issue description

Double clicking on `$MyNode` in the script editor will select the whole name including the "$".

But double clicking on `%MyNode` (unique name) will select the name but will not include the "%".

Dragging a node from the scene tree into the script editor brings up the property/method hint list, even though a "." has not been typed. Pressing enter appends "new()" even though this makes no sense as there is no period so it is just appending it directly to the node name: `$MyNodenew()`


### Steps to reproduce

Type `%MyNode` in a script and double click on it.

Type `@onready var x =` in a script, drag a node from the scene tree, then press enter.


### Minimal reproduction project

N/A
}
		}
	}
	
	if (code_completion_options.size() == 0) {
		cancel_code_completion();
		return;
	}
	
	if (code_completion_options.size() == 1 && string_to_complete == code_completion_options[0].display) {
		cancel_code_completion();
		return;
	}
	code_completion_options.sort_custom<CodeCompletionOptionCompare>();
	code_completion_longest_line = MIN(max_width, theme_cache.code_completion_max_width * theme_cache.font_size);
	code_completion_current_selected = 0;
	code_completion_force_item_center = -1;
	code_completion_active = true;
	queue_redraw();
}
void CodeEdit::_lines_edited_from(int p_from_line, int p_to_line) {
	_update_delimiter_cache(p_from_line, p_to_line);
	if (p_from_line == p_to_line) {
		return;
	}
	lines_edited_changed += p_to_line - p_from_line;
	lines_edited_from = (lines_edited_from == -1) ? MIN(p_from_line, p_to_line) : MIN(lines_edited_from, MIN(p_from_line, p_to_line));
	lines_edited_to = (lines_edited_to == -1) ? MAX(p_from_line, p_to_line) : MAX(lines_edited_from, MAX(p_from_line, p_to_line));
}
void CodeEdit::_text_set() {