diff --git a/src/actions.c b/src/actions.c index 42464348..529bd028 100644 --- a/src/actions.c +++ b/src/actions.c @@ -25,9 +25,9 @@ #include /* waitpid */ #endif -void here(void) +void here(int i) { - fprintf(stderr, "here\n"); + fprintf(stderr, "here %d\n", i); } void set_modify(int mod) diff --git a/src/hilight.c b/src/hilight.c index 7c9afc9f..130930c9 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -947,6 +947,7 @@ void select_hilight_net(void) for(i=0;iwires;i++) { if( (entry = bus_hilight_lookup(xctx->wire[i].node, 0, XLOOKUP)) ) { xctx->wire[i].sel = SELECTED; + xctx->ui_state|=SELECTION; } } for(i=0;iinstances;i++) { @@ -956,6 +957,7 @@ void select_hilight_net(void) if( xctx->inst[i].color) { dbg(1, "select_hilight_net(): instance %d flags &4 true\n", i); xctx->inst[i].sel = SELECTED; + xctx->ui_state|=SELECTION; } else if(hilight_connected_inst) { int rects, j; @@ -966,6 +968,7 @@ void select_hilight_net(void) entry=bus_hilight_lookup(xctx->inst[i].node[j], 0, XLOOKUP); if(entry) { xctx->inst[i].sel = SELECTED; + xctx->ui_state|=SELECTION; break; } } @@ -974,6 +977,7 @@ void select_hilight_net(void) } else if( type && IS_LABEL_SH_OR_PIN(type) ) { entry=bus_hilight_lookup(xctx->inst[i].lab , 0, XLOOKUP); if(entry) xctx->inst[i].sel = SELECTED; + xctx->ui_state|=SELECTION; } } xctx->need_reb_sel_arr = 1; @@ -995,6 +999,7 @@ void draw_hilight_net(int on_window) struct instentry *instanceptr; if(!xctx->hilight_nets) return; + dbg(3, "draw_hilight_net(): xctx->prep_hi_structs=%d\n", xctx->prep_hi_structs); prepare_netlist_structs(0); save_draw = draw_window; draw_window = on_window; @@ -1040,6 +1045,7 @@ void draw_hilight_net(int on_window) if(use_hash) init_inst_iterator(x1, y1, x2, y2); else i = -1; while(1) { + char *type; if(use_hash) { if( !(instanceptr = inst_iterator_next())) break; i = instanceptr->n; @@ -1048,9 +1054,14 @@ void draw_hilight_net(int on_window) i++; if(i >= xctx->instances) break; } + type = (xctx->inst[i].ptr+ xctx->sym)->type; + /* after an undo xctx->inst[i].color is gone, so rebuild it for labels/pins */ + if( type && xctx->inst[i].color == 0 && IS_LABEL_SH_OR_PIN(type) ) { + entry=bus_hilight_lookup(xctx->inst[i].lab, 0, XLOOKUP); + if(entry) xctx->inst[i].color = get_color(entry->value); + } if(xctx->inst[i].color ) { - dbg(1, "draw_hilight_net(): instance:%d\n",i); symptr = (xctx->inst[i].ptr+ xctx->sym); if( c==0 || /*draw_symbol call is needed on layer 0 to avoid redundant work (outside check) */ symptr->lines[c] || diff --git a/src/save.c b/src/save.c index d894b553..19b5ed37 100644 --- a/src/save.c +++ b/src/save.c @@ -952,7 +952,7 @@ int save_schematic(const char *schname) /* 20171020 added return value */ return 0; } -void link_symbols_to_instances(int from) +void link_symbols_to_instances(int from) /* from > 0 : linking symbols from pasted schematic / clipboard */ { int i; char *type=NULL; @@ -966,6 +966,7 @@ void link_symbols_to_instances(int from) xctx->inst[i].ptr = match_symbol(xctx->inst[i].name); } for(i = from; i < xctx->instances; i++) { + if(from) select_element(i,SELECTED,1, 0); /* leave elements selected if a paste/copy from windows is done */ symbol_bbox(i, &xctx->inst[i].x1, &xctx->inst[i].y1, &xctx->inst[i].x2, &xctx->inst[i].y2); type=xctx->sym[xctx->inst[i].ptr].type; cond= !type || !IS_LABEL_SH_OR_PIN(type); diff --git a/src/xschem.h b/src/xschem.h index cdf70c5f..db1f0401 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -800,7 +800,7 @@ extern void set_grid(double); extern void create_plot_cmd(int viewer); extern void set_modify(int mod); extern void dbg(int level, char *fmt, ...); -extern void here(void); +extern void here(int i); extern void print_version(void); extern int set_netlist_dir(int force, char *dir); extern void netlist_options(int i);