[BUG] Editor upper-case commands do not work #3462
Labels
bug
An actual error or unwanted behavior.
needs-triage
Yet to be looked at and verified as an a real issue/feature that could be worked on
Describe the bug
This is kind of two closely related issues in one:
Issue 1
Upper-case editor commands, such as
:UU
and:DD
do not work and call their lower-case equivalent if it exists.This is because user input is in lower-case by the time it reaches the command. This is done by
build_matches()
in the command parser:This lower-cased value is then stored in
cmdstring
by the commmand handler:This is then used in the command's
func()
:Issue 2
The unit tests for the upper-case commands do not fail even though the commands do not work in the editor. This is because the unit tests set
cmdstring
directly, bypassing the lower-casing done by the command parser:I suspect that when the editor commands were originally created they did work and the lower-casing was something that was changed later, but because the unit tests directly set
cmdstring
they continued to pass.Resolution
I think it would be too messy/hacky to allow upper-case commands through and this might not work for anyone who uses a different command parser.
The logical solution to me would be to replace the upper-case editor commands with lower-case versions, such as
u!
andd!
. This would fix the broken commands for the default installation.This is what I have done in my own installation but I wanted to open it up for comment in case there's a better way to do it.
There is also the issue of the unit tests, which I do not know how to fix so that they will catch upper-case failures. Although now, anyone trying to add an upper-case editor command would find that it wouldn't work in-game.
The text was updated successfully, but these errors were encountered: