From 2d093a0b540a33ea360f20e3accf9bf0365e5cce Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 19 May 2020 09:13:12 -0400 Subject: [PATCH] Corrected an error where a label is incorrectly unselected when "Parameterize" has been called from the menu while the label is being created, causing a crash. In the same place in the code, corrected the position of the text cursor to account for the added parameter start and end markers. --- VERSION | 2 +- menucalls.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 1e96453..8e8781c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.10.24 +3.10.25 diff --git a/menucalls.c b/menucalls.c index 6bf5375..22ebe66 100644 --- a/menucalls.c +++ b/menucalls.c @@ -504,7 +504,6 @@ void setosize(xcWidget w, objinstptr dataptr) } } } - /* unselect_all(); */ if (waschanged) undo_finish_series(); pwriteback(areawin->topinstance); drawarea(NULL, NULL, NULL); @@ -1222,7 +1221,13 @@ void stringparam(xcWidget w, caddr_t clientdata, caddr_t calldata) if (eventmode == TEXT_MODE || eventmode == ETEXT_MODE) { settext = (genericptr *)EDITPART; makeparam(TOLABEL(settext), _STR2); - unselect_all(); + if (eventmode == ETEXT_MODE) + unselect_all(); + else + /* Move cursor position to account for the parameter */ + /* start and end markers that have been added to the */ + /* string. */ + areawin->textpos += 2; setparammarks(NULL); } else if (checkselect(LABEL)) parameterize(P_SUBSTRING, _STR2, -1); -- 2.11.4.GIT