Skip to content

Commit 3fa315c

Browse files
committed
Improve reading of legacy mask files and allow mask comments starting with -
1 parent 837c5ed commit 3fa315c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tcl/windows/tree.tcl

Lines changed: 11 additions & 3 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
}
@@ -580,7 +580,7 @@ proc ::tree::displayLines { baseNumber moves } {
580580
set comment [lindex $m 3]
581581
set firstLine [ lindex [split $comment "\n"] 0 ]
582582
$w.f.tl insert end " $firstLine\n" tagtooltip$idx
583-
::utils::tooltip::Set $w.f.tl -tag tagtooltip$idx $comment
583+
::utils::tooltip::Set $w.f.tl -tag tagtooltip$idx -- $comment
584584

585585
# Bind right button to popup a contextual menu:
586586
$w.f.tl tag bind tagclick$idx <ButtonPress-$::MB3> "::tree::mask::contextMenu $w.f.tl [lindex $m 0] %x %y %X %Y ; break"
@@ -1620,6 +1620,14 @@ proc ::tree::mask::getImage { move nmr } {
16201620
set loc [expr 4 + $nmr]
16211621
set img [lindex $moves $idxm $loc]
16221622
if {$img == ""} { set img tb_empty }
1623+
if {[string match "::tree::mask::image*" $img]} {
1624+
set type [string range $img 19 end]
1625+
if {[info exists ::tree::mask::marker2image($type)]} {
1626+
set img $::tree::mask::marker2image($type)
1627+
} else {
1628+
set img tb_empty
1629+
}
1630+
}
16231631
return $img
16241632
}
16251633

0 commit comments

Comments
 (0)