Skip to content

Commit

Permalink
fix: show correct rel link when state selected
Browse files Browse the repository at this point in the history
  • Loading branch information
pancsta committed Mar 1, 2024
1 parent 1aeff8d commit 8118506
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
15 changes: 11 additions & 4 deletions tools/am-dbg/debugger/debugger.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,17 @@ type MsgTxParsed struct {
}

type nodeRef struct {
stateName string
isRef bool
isRel bool
rel am.Relation
// node is a state (reference or top level)
stateName string
// node is a state reference, not a top level state
// eg Bar in case of: Foo -> Remove -> Bar
// TODO name collision with nodeRef
isRef bool
// node is a relation (Remove, Add, Require, After)
isRel bool
// relation type (if isRel)
rel am.Relation
// top level state name (for both rels and refs)
parentState string
}

Expand Down
5 changes: 2 additions & 3 deletions tools/am-dbg/debugger/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ func (d *Debugger) updateTreeDefaultsHighlights(msg telemetry.Msg) {
color = colorActive
}
// reset to defaults
node.SetText(stateName)
// reset to defaults
if stateName != d.selectedState {
if !ref.isRef {
// un-highlight all descendants
Expand All @@ -99,9 +101,6 @@ func (d *Debugger) updateTreeDefaultsHighlights(msg telemetry.Msg) {
stateName), 10)
node.SetColor(color)
node.SetText(stateName + " (" + tick + ")")
} else {
// reset to defaults
node.SetText(stateName)
}
return true
}
Expand Down

0 comments on commit 8118506

Please sign in to comment.