Corrected the list produced by "what -listall" to have the intended

nesting.  Corrected the "select visible" command, which got broken
during the modifications.
This commit is contained in:
Tim Edwards 2021-03-24 20:20:55 -04:00
parent f5d8dbc3e5
commit 2d1cf8435a
2 changed files with 13 additions and 10 deletions

View File

@ -633,8 +633,7 @@ cmdSelectArea(layers, less, option)
TTMaskClearType(&mask, i); TTMaskClearType(&mask, i);
} }
} }
else SelectArea(&scx, &mask, crec->dbw_bitmask);
SelectArea(&scx, &mask, crec->dbw_bitmask);
} }
/* /*

View File

@ -913,7 +913,7 @@ CmdWhat(w, cmd)
CellUse *CheckUse; CellUse *CheckUse;
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
Tcl_Obj *lobj, *paintobj, *paintcellobj, *labelobj, *cellobj; Tcl_Obj *lobj, *paintobj, *paintcellobj, *celllistobj, *labelobj, *cellobj;
extern int cmdWhatCellListFunc(); extern int cmdWhatCellListFunc();
#endif #endif
@ -928,10 +928,7 @@ CmdWhat(w, cmd)
if (!strncmp(cmd->tx_argv[locargc - 1], "-list", 5)) if (!strncmp(cmd->tx_argv[locargc - 1], "-list", 5))
{ {
if (!strncmp(cmd->tx_argv[locargc - 1], "-listall", 8)) if (!strncmp(cmd->tx_argv[locargc - 1], "-listall", 8))
{
doListAll = TRUE; doListAll = TRUE;
paintcellobj = Tcl_NewListObj(0, NULL);
}
else else
doList = TRUE; doList = TRUE;
locargc--; locargc--;
@ -1015,6 +1012,8 @@ CmdWhat(w, cmd)
TTMaskSetOnlyType(&maskBits, i); TTMaskSetOnlyType(&maskBits, i);
if (DBIsContact(i)) DBMaskAddStacking(&maskBits); if (DBIsContact(i)) DBMaskAddStacking(&maskBits);
if (doListAll) paintcellobj = Tcl_NewListObj(0, NULL);
/* Search selection for tiles of this type, then */ /* Search selection for tiles of this type, then */
/* call cmdFindWhatTileFunc() to search the cell */ /* call cmdFindWhatTileFunc() to search the cell */
/* def in the area of that tile to determine what */ /* def in the area of that tile to determine what */
@ -1038,12 +1037,16 @@ CmdWhat(w, cmd)
} }
else else
{ {
Tcl_ListObjAppendElement(magicinterp, paintobj, Tcl_ListObjAppendElement(magicinterp, paintcellobj,
Tcl_NewStringObj(DBTypeLongName(i), -1)); Tcl_NewStringObj(DBTypeLongName(i), -1));
celllistobj = Tcl_NewListObj(0, NULL);
for (lidp = lid; lidp; lidp = lidp->lid_next) for (lidp = lid; lidp; lidp = lidp->lid_next)
Tcl_ListObjAppendElement(magicinterp, paintcellobj, Tcl_ListObjAppendElement(magicinterp, celllistobj,
Tcl_NewStringObj(lidp->lid_name, -1)); Tcl_NewStringObj(lidp->lid_name, -1));
Tcl_ListObjAppendElement(magicinterp, paintcellobj,
celllistobj);
} }
while (lid != NULL) while (lid != NULL)
@ -1051,11 +1054,12 @@ CmdWhat(w, cmd)
freeMagic(lid); freeMagic(lid);
lid = lid->lid_next; lid = lid->lid_next;
} }
if (doListAll)
Tcl_ListObjAppendElement(magicinterp, paintobj,
paintcellobj);
} }
} }
EditCellUse = saveUse; EditCellUse = saveUse;
if (doListAll)
Tcl_ListObjAppendElement(magicinterp, paintobj, paintcellobj);
} }
else else