1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2025-02-01 21:55:01 +01:00

Prevent typing pipes in the script editor

This prevents users from being confused whenever they type a pipe in the
script editor, then save the level and load it again and see their
script lines unexpectedly splitting in two. Now if you attempt to type a
pipe, it simply won't happen at all.

Fixes #379.
This commit is contained in:
Misa 2020-09-27 15:14:42 -07:00 committed by Ethan Lee
parent 25f27d502a
commit 695e720c1c

View file

@ -4186,6 +4186,9 @@ void editorinput()
ed.keydelay=6;
}
// Remove all pipes, they are the line separator in the XML
key.keybuffer.erase(std::remove(key.keybuffer.begin(), key.keybuffer.end(), '|'), key.keybuffer.end());
ed.sb[ed.pagey+ed.sby]=key.keybuffer;
ed.sbx = utf8::unchecked::distance(ed.sb[ed.pagey+ed.sby].begin(), ed.sb[ed.pagey+ed.sby].end());