Skip to content

Commit

Permalink
Merge pull request #69 from bobrik/ivan/square-brackets
Browse files Browse the repository at this point in the history
Fix invisible square [frame] in stackcollapse frame view
  • Loading branch information
laixintao authored Jan 8, 2024
2 parents 52519c4 + 0492765 commit 97ef394
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flameshow/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def render_detail(self, sample_index: int, sample_unit: str):
Text.assemble(
(" ", Style(bgcolor=frame.display_color.rich_color)),
" ",
Text.from_markup(line),
line,
)
)
frame = frame.parent
Expand Down
4 changes: 3 additions & 1 deletion flameshow/parsers/stackcollapse_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import re
from typing import Dict

from rich.text import Text

from flameshow.models import Frame, Profile, SampleType

logger = logging.getLogger(__name__)
Expand All @@ -12,7 +14,7 @@ class StackCollapseFrame(Frame):
def render_one_frame_detail(
self, frame, sample_index: int, sample_unit: str
):
return [f"{frame.name}\n"]
return [Text(f"{frame.name}\n")]


class StackCollapseParser:
Expand Down
4 changes: 3 additions & 1 deletion flameshow/pprof_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import logging
from typing import Dict, List

from rich.text import Text

from flameshow.models import Frame, Profile, SampleType

from . import profile_pb2
Expand Down Expand Up @@ -112,7 +114,7 @@ def render_one_frame_detail(self, frame, sample_index, sample_unit):
f" [grey37]{frame.line.function.filename}, [b]line"
f" {frame.line.line_no}[/b][/grey37]\n"
)
return [line1, line2]
return [Text.from_markup(line1), Text.from_markup(line2)]

@property
def title(self) -> str:
Expand Down

0 comments on commit 97ef394

Please sign in to comment.