3 source/smartIndent.c | 12 +++---------
4 1 files changed, 3 insertions(+), 9 deletions(-)
6 diff --quilt old/source/smartIndent.c new/source/smartIndent.c
7 --- old/source/smartIndent.c
8 +++ new/source/smartIndent.c
9 @@ -816,12 +816,11 @@ void SmartIndentCB(Widget w, XtPointer c
11 static void executeNewlineMacro(WindowInfo *window, smartIndentCBStruct *cbInfo)
13 windowSmartIndentData *winData =
14 (windowSmartIndentData *)window->smartIndentData;
15 - /* posValue probably shouldn't be static due to re-entrance issues <slobasso> */
16 - static DataValue posValue = {INT_TAG, {0}};
17 + DataValue posValue = {INT_TAG, {0}};
19 RestartData *continuation;
23 @@ -887,40 +886,35 @@ Boolean InSmartIndentMacros(WindowInfo *
25 static void executeModMacro(WindowInfo *window,smartIndentCBStruct *cbInfo)
27 windowSmartIndentData *winData =
28 (windowSmartIndentData *)window->smartIndentData;
29 - /* args probably shouldn't be static due to future re-entrance issues <slobasso> */
30 - static DataValue args[2] = {{INT_TAG, {0}}, {STRING_TAG, {0}}};
31 - /* after 5.2 release remove inModCB and use new winData->inModMacro value */
32 - static int inModCB = False;
33 + DataValue args[2] = {{INT_TAG, {0}}, {STRING_TAG, {0}}};
35 RestartData *continuation;
39 /* Check for inappropriate calls and prevent re-entering if the macro
40 makes a buffer modification */
41 - if (winData == NULL || winData->modMacro == NULL || inModCB)
42 + if (winData == NULL || winData->modMacro == NULL || winData->inModMacro)
45 /* Call modification macro with the position of the modification,
46 and the character(s) inserted. Don't allow
47 preemption or time limit. Execution must not overlap or re-enter */
48 args[0].val.n = cbInfo->pos;
49 AllocNStringCpy(&args[1].val.str, cbInfo->charsTyped);
52 ++(winData->inModMacro);
54 stat = ExecuteMacro(window, winData->modMacro, 2, args, &result,
55 &continuation, &errMsg);
56 while (stat == MACRO_TIME_LIMIT)
57 stat = ContinueMacro(continuation, &result, &errMsg);
59 --(winData->inModMacro);
62 /* Process errors in macro execution */
63 if (stat == MACRO_PREEMPT || stat == MACRO_ERROR)
65 DialogF(DF_ERR, window->shell, 1, "Smart Indent",