Skip to content

Commit 9081c19

Browse files
committed
Only highlight if there's more than one node.
1 parent 1a3cad8 commit 9081c19

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/vscode/extension.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ export async function activate(context: vscode.ExtensionContext) {
234234
}
235235
// TODO: Highlighting in the DOT is a cute trick, but might become less effective on larger functions.
236236
// So it works for now, but I'll probably need to replace it with CSS so that I only render once per function.
237-
const nodeToHighlight = highlightCurrentNode
237+
238+
// Only highlight if there's more than one node to the graph.
239+
const shouldHighlight = highlightCurrentNode && cfg.graph.order > 1;
240+
const nodeToHighlight = shouldHighlight
238241
? getValue(cfg.offsetToNode, offset)
239242
: undefined;
240243
const dot = graphToDot(cfg, false, nodeToHighlight);

0 commit comments

Comments
 (0)