From 0c25490c9d02313b0176d9267c5003fa8ee9b7ee Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sat, 24 Jan 2026 19:51:01 +0100 Subject: [PATCH] launchers: tclcommand attribute defined in the symbol will be used if no instance tclcommand attribute found --- src/actions.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/actions.c b/src/actions.c index 946de815..6a62b665 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1854,6 +1854,7 @@ void launcher(void) tcleval("update"); if(xctx->lastsel ==1) { + size_t tclcommand_found; double mx=xctx->mousex, my=xctx->mousey; n=xctx->sel_array[0].n; c=xctx->sel_array[0].col; @@ -1864,7 +1865,12 @@ void launcher(void) else if(xctx->sel_array[0].type==LINE) prop_ptr = xctx->line[c][n].prop_ptr; else if(xctx->sel_array[0].type==WIRE) prop_ptr = xctx->wire[n].prop_ptr; else if(xctx->sel_array[0].type==xTEXT) prop_ptr = xctx->text[n].prop_ptr; - my_strdup2(_ALLOC_ID_, &command, get_tok_value(prop_ptr,"tclcommand",0)); + my_strdup2(_ALLOC_ID_, &command, get_tok_value(prop_ptr, "tclcommand", 0)); + tclcommand_found = xctx->tok_size; + if(!tclcommand_found && xctx->sel_array[0].type==ELEMENT) { + xSymbol *sym = xctx->inst[n].ptr + xctx->sym; + my_strdup2(_ALLOC_ID_, &command, get_tok_value(sym->prop_ptr, "tclcommand", 0)); + } if(strchr(command, '@')) { my_strdup2(_ALLOC_ID_, &command, translate3(command, 1, prop_ptr, NULL, NULL, NULL)); if(xctx->sel_array[0].type==ELEMENT) {