### 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
for (; line_col < cc; line_col++) {
				char32_t c = line[line_col];
				if (auto_indent_prefixes.has(c) && is_in_comment(cl, line_col) == -1) {
					should_indent = true;
					indent_char = c;
					continue;
				}
				
				
				if (should_indent && (!is_whitespace(c) && is_in_comment(cl, line_col + 1) == -1)) {
					should_indent = false;
				}
			}
			if (should_indent) {
				ins += indent_text;
				String closing_pair = get_auto_brace_completion_close_key(String::chr(indent_char));
				if (!closing_pair.is_empty() && line.find(closing_pair, cc) == cc) {
					
					if (p_split_current_line) {
						brace_indent = true;
						ins += "\n" + ins.substr(indent_text.size(), ins.length() - 2);
					} else {
						brace_indent = false;
						ins = "\n" + ins.substr(indent_text.size(), ins.length() - 2);
					}
				}
			}
		}
		bool first_line = false;
		if (!p_split_current_line) {