From: Holger Schemel Date: Thu, 7 Jan 2021 23:05:49 +0000 (+0100) Subject: minor code cleanup X-Git-Tag: 4.2.2.1~8 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=6190042e932e3843eebcb863247b32772251bcea;p=rocksndiamonds.git minor code cleanup --- diff --git a/src/screens.c b/src/screens.c index d7e5016a..81643f1c 100644 --- a/src/screens.c +++ b/src/screens.c @@ -4258,19 +4258,13 @@ static void HandleTypeNameExt(boolean initialize, Key key) name[xpos] = 0; } - else if (key == KSYM_Return) + else if (key == KSYM_Return || key == KSYM_Escape) { - StopTextInput(); - - setTypeNameValues(name, pos, TRUE); + boolean changed = (key == KSYM_Return); - active = FALSE; - } - else if (key == KSYM_Escape) - { StopTextInput(); - setTypeNameValues(name, pos, FALSE); + setTypeNameValues(name, pos, changed); active = FALSE; }