From 0318905a25778e24c62c07cd200ff8fef3e8784f Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Mon, 10 Nov 2025 18:55:44 +0100 Subject: [PATCH] improve tclcmd_ok procedure --- src/xschem.tcl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/xschem.tcl b/src/xschem.tcl index b003cd60..6f151dc4 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -6315,9 +6315,20 @@ proc tclcmd_ok_button {} { set tclcmd_txt [.tclcmd.t.t get 1.0 end] regsub -all -line {^ *= *} $tclcmd_txt {= } tclcmd_txt redef_puts - catch {uplevel #0 $tclcmd_txt} tclcmd_puts + catch {uplevel #0 $tclcmd_txt} tclcmd_cmd rename puts {} rename ::tcl::puts puts + if {$tclcmd_cmd ne {}} { + if {$tclcmd_puts ne {}} { + if {[string index $tclcmd_puts end] != "\n"} { + append tclcmd_puts \n $tclcmd_cmd + } else { + append tclcmd_puts $tclcmd_cmd + } + } else { + set tclcmd_puts $tclcmd_cmd + } + } if {$tclcmd_puts != {} && [string index $tclcmd_puts end] != "\n"} { append tclcmd_puts "\n" }