diff --git a/commands/CmdE.c b/commands/CmdE.c index 537c1f2f..f6163ed2 100644 --- a/commands/CmdE.c +++ b/commands/CmdE.c @@ -56,10 +56,12 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/ * * Implement the "edit" command. * Use the cell that is currently selected as the edit cell. If more than - * one cell is selected, use the point to choose between them. + * one cell is selected, use the point to choose between them. If the + * optional argument "" is provided, then edit the specified + * instance (if it exists in the current layout window). * * Usage: - * edit + * edit [] * * Results: * None. @@ -82,13 +84,24 @@ CmdEdit(w, cmd) TxCommand *cmd; { Rect area, pointArea; - CellUse *usave; + CellUse *usave, *use = NULL; CellDef *csave; int cmdEditRedisplayFunc(); /* Forward declaration. */ int cmdEditEnumFunc(); /* Forward declaration. */ bool noCurrentUse = FALSE; - if (cmd->tx_argc > 1) + if ((w != NULL) && (cmd->tx_argc == 2)) + { + CellUse *rootUse; + SearchContext scx; + + rootUse = (CellUse *)w->w_surfaceID; + bzero(&scx, sizeof(SearchContext)); + DBTreeFindUse(cmd->tx_argv[1], rootUse, &scx); + use = scx.scx_use; + } + + if ((use == NULL) && (cmd->tx_argc > 1)) { TxError("Usage: edit\nMaybe you want the \"load\" command\n"); return; @@ -121,10 +134,18 @@ CmdEdit(w, cmd) cmdFoundNewEdit = FALSE; csave = EditRootDef; usave = EditCellUse; - EditCellUse = NULL; - (void) SelEnumCells(FALSE, (bool *) NULL, (SearchContext *) NULL, - cmdEditEnumFunc, (ClientData) &pointArea); + if (use == NULL) + { + EditCellUse = NULL; + SelEnumCells(FALSE, (bool *) NULL, (SearchContext *) NULL, + cmdEditEnumFunc, (ClientData) &pointArea); + } + else + { + EditCellUse = use; + cmdFoundNewEdit = TRUE; + } if (EditCellUse == (CellUse *)NULL) { diff --git a/doc/html/edit.html b/doc/html/edit.html index 79677855..e5c53132 100644 --- a/doc/html/edit.html +++ b/doc/html/edit.html @@ -20,7 +20,7 @@

edit


-Use selected cell as new edit cell +Use selected cell as new edit cell, or specify cell to edit.

Shortcuts:

@@ -30,12 +30,17 @@ Use selected cell as new edit cell

Usage:

- edit

+ edit [instance]

Summary:

- The edit command makes the selected cell the new edit cell. + With no arguments, the edit command makes the selected cell the + new edit cell. If more than one cell is selected, then the one closest + to the pointer position is used.

+ With argument instance, makes the instance named instance + the new edit cell, if instance exists and is in the current layout + window.

Implementation Notes:

diff --git a/extflat/EFbuild.c b/extflat/EFbuild.c index 2ea61319..0f4c4fab 100644 --- a/extflat/EFbuild.c +++ b/extflat/EFbuild.c @@ -547,7 +547,7 @@ efBuildEquiv(def, nodeName1, nodeName2, resist, isspice) if (nn1 && nn2 && (nn1->efnn_port >= 0) && (nn2->efnn_port >= 0) && (nn1->efnn_port != nn2->efnn_port)) { - equalByCase = FALSE; + bool equalByCase = FALSE; if (isspice) { /* If ports have the same name under the assumption of