Skip to content

Commit b159948

Browse files
committed
Fixing legacy mask file loading and comments starting with -
1 parent 3fa315c commit b159948

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

tcl/start.tcl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,13 @@ proc InitTooltip {} {
253253
source [file nativename [file join $::scidTclDir "utils/tklib_tooltip.tcl"]]
254254
}
255255
namespace eval ::utils::tooltip {
256-
proc Set {args} { tooltip::tooltip {*}$args }
256+
proc Set {args} {
257+
set msg [lindex $args end]
258+
if {[string match "-*" $msg]} {
259+
set args [lreplace $args end end " $msg"]
260+
}
261+
tooltip::tooltip {*}$args
262+
}
257263
}
258264
}
259265
InitTooltip

tcl/utils/tklib_tooltip.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ proc ::tooltip::register {w args} {
190190
while {[string match -* $key]} {
191191
switch -- $key {
192192
-- {
193-
set args [lassign $args _ key]
193+
set args [lassign $args _]
194194
break
195195
}
196196
-heading {

tcl/windows/tree.tcl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ proc ::tree::displayLines { baseNumber moves } {
453453
set hasPositionComment 1
454454
set firstLine [ lindex [split $posComment "\n"] 0 ]
455455
$w.f.tl insert end "$firstLine\n" [ list bluefg tagtooltip_poscomment ]
456-
::utils::tooltip::Set $w.f.tl -tag tagtooltip_poscomment -- $posComment
456+
::utils::tooltip::Set $w.f.tl -tag tagtooltip_poscomment $posComment
457457
$w.f.tl tag bind tagtooltip_poscomment <Double-Button-1> "::tree::mask::addComment"
458458
}
459459
}
@@ -521,7 +521,7 @@ proc ::tree::displayLines { baseNumber moves } {
521521
if {$comment != ""} {
522522
set firstLine [ lindex [split $comment "\n"] 0 ]
523523
$w.f.tl insert end " $firstLine" tagtooltip$i
524-
::utils::tooltip::Set $w.f.tl -tag tagtooltip$i -- $comment
524+
::utils::tooltip::Set $w.f.tl -tag tagtooltip$i $comment
525525
$w.f.tl tag bind tagtooltip$i <Double-Button-1> "::tree::mask::addComment $move"
526526
}
527527
}
@@ -578,9 +578,13 @@ proc ::tree::displayLines { baseNumber moves } {
578578
$w.f.tl insert end "[::trans [lindex $m 0] ]" bluefg
579579
# comment
580580
set comment [lindex $m 3]
581-
set firstLine [ lindex [split $comment "\n"] 0 ]
582-
$w.f.tl insert end " $firstLine\n" tagtooltip$idx
583-
::utils::tooltip::Set $w.f.tl -tag tagtooltip$idx -- $comment
581+
if {$comment != ""} {
582+
set firstLine [ lindex [split $comment "\n"] 0 ]
583+
$w.f.tl insert end " $firstLine" tagtooltip$idx
584+
::utils::tooltip::Set $w.f.tl -tag tagtooltip$idx $comment
585+
$w.f.tl tag bind tagtooltip$idx <Double-Button-1> "::tree::mask::addComment [lindex $m 0]"
586+
}
587+
$w.f.tl insert end "\n"
584588

585589
# Bind right button to popup a contextual menu:
586590
$w.f.tl tag bind tagclick$idx <ButtonPress-$::MB3> "::tree::mask::contextMenu $w.f.tl [lindex $m 0] %x %y %X %Y ; break"

0 commit comments

Comments
 (0)