Skip to content
Prev Previous commit
Merge remote-tracking branch 'upstream/main' into gh-138122-colors
  • Loading branch information
pablogsal committed Jan 1, 2026
commit e5b702b090a8698c4077f57b396ced477895f116
19 changes: 17 additions & 2 deletions Lib/profiling/sampling/live_collector/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,19 @@ def get_trend_color(column_name):
samples_str = f"{direct_calls}/{cumulative_calls}"
col = 0

# Samples column - apply trend color
# Fill entire row with reverse video background for selected row
if is_selected:
self.add_str(line, 0, " " * (width - 1), A_REVERSE | A_BOLD)

# Show selection indicator when opcode panel is enabled
if show_opcodes:
if is_selected:
self.add_str(line, col, "►", A_REVERSE | A_BOLD)
else:
self.add_str(line, col, " ", curses.A_NORMAL)
col += 2

# Samples column - apply trend color based on nsamples trend
nsamples_color = get_trend_color("nsamples")
self.add_str(line, col, f"{samples_str:>13} ", nsamples_color)
col += 15
Expand Down Expand Up @@ -830,7 +842,10 @@ def get_trend_color(column_name):
simplified_path = self.collector.simplify_path(filename)
file_line = f"{simplified_path}:{lineno}"
remaining_width = width - col - 1
self.add_str(line, col, file_line[:remaining_width], color_file)
file_color = A_REVERSE | A_BOLD if is_selected else color_file
self.add_str(
line, col, file_line[:remaining_width], file_color
)

line += 1

Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.