From a317ca047a47ac0668b4453e6606fd6de885e1bd Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Wed, 4 Oct 2023 00:12:53 +1100 Subject: [PATCH] punk::ns display fix --- src/modules/punk/ns-999999.0a1.0.tm | 31 +++++++++++++++++------------ 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/modules/punk/ns-999999.0a1.0.tm b/src/modules/punk/ns-999999.0a1.0.tm index b81632de..8c996359 100644 --- a/src/modules/punk/ns-999999.0a1.0.tm +++ b/src/modules/punk/ns-999999.0a1.0.tm @@ -828,12 +828,13 @@ namespace eval punk::ns { } else { set width [textblock::width $block] } - if {$width > 0} { + #if multiple results or if there is only 1 result - but we are path-globbing - then we need to show location + if {$count_with_results > 1 || [regexp {[*?]} [nsprefix $ns_absolute]]} { append output \n [dict get $nsdict location] \n - append output $block - if {$count_with_results > 1} { - append output \n [string repeat - $width] - } + } + append output $block + if {$count_with_results > 1 } { + append output \n [string repeat - $width] } } return $output @@ -1009,17 +1010,21 @@ namespace eval punk::ns { set imported $allimported set undetermined $allundetermined } + + #itemcount will overcount if we are including commands as well as procs/exported etc - set itemcount 0 incr itemcount [llength $tailmatches] incr itemcount [llength $commands] - incr itemcount [llength $procs] - incr itemcount [llength $exported] - incr itemcount [llength $imported] - incr itemcount [llength $aliases] - incr itemcount [llength $ensembles] - incr itemcount [llength $ooobjects] - incr itemcount [llength $ooclasses] - incr itemcount [llength $exportpatterns] + + + #incr itemcount [llength $procs] + #incr itemcount [llength $exported] + #incr itemcount [llength $imported] + #incr itemcount [llength $aliases] + #incr itemcount [llength $ensembles] + #incr itemcount [llength $ooobjects] + #incr itemcount [llength $ooclasses] + #definitely don't count exportpatterns incr itemcount [llength $undetermined] lappend nsdict_list [dict create\