godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.15k stars 20.21k forks source link

Unicode Character “¨” (U+00A8) breaks the Script Editor (edition/save no longer possible) #92909

Open mpalomas opened 3 months ago

mpalomas commented 3 months ago

Tested versions

4.3 beta 1

System information

Ubuntu 24.04 under Gnome

Issue description

In the GDScript editor, when using a US international with dead keys keyboard layout, if you press the " (double quote) key, the script editor will interpret it, and display it as Unicode Character “¨” (U+00A8) and does not like it at all: it is impossible to do any further edit in the file. You can still move the cursor around in the file, but edition becomes impossible. Also you can no longer save the file.

Godot will complain with parsing errors:

Godot Engine v4.3.beta1.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
--- Debug adapter server started on port 6006 ---
--- GDScript language server started on port 6005 ---
New Scene Root
Attach Script
  res://node_3d.gd:6 - Parse Error: Invalid character "¨" (U+00A8).
  modules/gdscript/gdscript.cpp:2943 - Failed to load script "res://node_3d.gd" with error "Parse error". (User)
  res://node_3d.gd:6 - Parse Error: Invalid character "¨" (U+00A8).
  res://node_3d.gd:6 - Parse Error: Invalid character "¨" (U+00A8).
  res://node_3d.gd:6 - Parse Error: Invalid character "¨" (U+00A8).

Even closing/reopening the file does not help: edition is still impossible in this file. My workaround is to close the project, edit the file with any text editor, then reopen the project.

Should be possible to reproduce with other keyboard layout, or just copy-paste the character I guess ?

Just for the context, using the mentioned keyboard layout, in most editors (such as this Github issue editor), you need to press " key and then space to actually produce the double quote properly. If you don´t press space then it is indeed shown as the Diaeresis char.

Steps to reproduce

Minimal reproduction project (MRP)

No MRP because when you type the character, you can no longer save the file !

adamscott commented 3 months ago

@mpalomas Can you test if this issue is reproducible in previous versions of 4.3 or in 4.2?

bruvzg commented 3 months ago

I can't reproduce it, it will print parse errors (which is expected, this is an invalid character), but editing/saving is working fine. Please provide an example of broken file.

mpalomas commented 3 months ago

I was able to reproduce in 4.2 yes, although the error message is slightly different from 4.3.

Now the problem is, this bug, at least on my system, only occurs when you actually type the character in the script editor.

I tried to to type the character for instance in VSCode, then open the project and script in Godot: script editor is happy no problem. But then if I type it within the editor the bug occurs.

Can you guys recommend an easy to use screen/video recording tool for Linux? Best I can do is record a short clip.

Anyway, I am now using the standard US Layout when I work with Godot, it's a minor annoyance at most.

HolonProduction commented 3 months ago

Sounds like #85664 Could you check the ibus version?