commands/CmdFI.c: added CmdFlush_NoConfirm option to disable flush prompt

This commit is contained in:
Carsten Wulff
2024-12-26 12:49:33 -05:00
committed by Tim Edwards
parent d79533a255
commit 772bfe2f71
+7
View File
@@ -943,6 +943,7 @@ CmdFlush(w, cmd)
static char *actionNames[] = { "no", "yes", 0 }; static char *actionNames[] = { "no", "yes", 0 };
char *prompt; char *prompt;
bool dereference = FALSE; bool dereference = FALSE;
char *strNoConfirm;
if (!strncmp(cmd->tx_argv[cmd->tx_argc - 1], "-deref", 6)) if (!strncmp(cmd->tx_argv[cmd->tx_argc - 1], "-deref", 6))
{ {
@@ -973,6 +974,11 @@ CmdFlush(w, cmd)
} }
} }
strNoConfirm = (char *)Tcl_GetVar(magicinterp, "CmdFlush_NoConfirm", TCL_GLOBAL_ONLY);
if(strNoConfirm){
TxPrintf("CmdFlush_NoConfirm set, skipping prompt.\n");
}else{
if (def->cd_flags & (CDMODIFIED|CDSTAMPSCHANGED|CDBOXESCHANGED)) if (def->cd_flags & (CDMODIFIED|CDSTAMPSCHANGED|CDBOXESCHANGED))
{ {
prompt = TxPrintString("Really throw away all changes made" prompt = TxPrintString("Really throw away all changes made"
@@ -981,6 +987,7 @@ CmdFlush(w, cmd)
if (action == 0) /* No */ if (action == 0) /* No */
return; return;
} }
}
cmdFlushCell(def, dereference); cmdFlushCell(def, dereference);
SelectClear(); SelectClear();