diff --git a/desktop_version/src/Editor.cpp b/desktop_version/src/Editor.cpp index 29124e59..1b90ae68 100644 --- a/desktop_version/src/Editor.cpp +++ b/desktop_version/src/Editor.cpp @@ -3472,6 +3472,20 @@ void editorinput(void) case EditorSubState_DRAW_INPUT: // We're taking input! + if (customentities[ed.text_entity].t == 18 || customentities[ed.text_entity].t == 19) + { + // This is a terminal or script box, so this is a script name. + // Remove all pipes, they are the line separator in the XML. + // When this loop reaches the end, it wraps to SIZE_MAX; SIZE_MAX + 1 is 0 + for (size_t i = key.keybuffer.length() - 1; i + 1 > 0; i--) + { + if (key.keybuffer[i] == '|') + { + key.keybuffer.erase(key.keybuffer.begin() + i); + } + } + } + if (escape_pressed) { // Cancel it, and remove the enemy it's tied to if necessary