diff options
| author | Gal Zahavi <[email protected]> | 2025-08-08 15:11:14 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-08 22:11:14 +0000 |
| commit | c03ae4377729fb993426e8535cb041f8014f7b3b (patch) | |
| tree | 1025e56fa6e78f01ae8b1e1d46331adda8324b3a /packages/cli/src/ui/utils/MarkdownDisplay.tsx | |
| parent | 69322e12e40ca1d69af83df2fca95bf4c51b8bfd (diff) | |
feat: Add option to hide line numbers in code blocks (#5857)
Co-authored-by: Jacob Richman <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/utils/MarkdownDisplay.tsx')
| -rw-r--r-- | packages/cli/src/ui/utils/MarkdownDisplay.tsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/cli/src/ui/utils/MarkdownDisplay.tsx b/packages/cli/src/ui/utils/MarkdownDisplay.tsx index eb5dc453..7568e1f8 100644 --- a/packages/cli/src/ui/utils/MarkdownDisplay.tsx +++ b/packages/cli/src/ui/utils/MarkdownDisplay.tsx @@ -10,6 +10,7 @@ import { Colors } from '../colors.js'; import { colorizeCode } from './CodeColorizer.js'; import { TableRenderer } from './TableRenderer.js'; import { RenderInline } from './InlineMarkdownRenderer.js'; +import { useSettings } from '../contexts/SettingsContext.js'; interface MarkdownDisplayProps { text: string; @@ -298,6 +299,7 @@ const RenderCodeBlockInternal: React.FC<RenderCodeBlockProps> = ({ availableTerminalHeight, terminalWidth, }) => { + const settings = useSettings(); const MIN_LINES_FOR_MESSAGE = 1; // Minimum lines to show before the "generating more" message const RESERVED_LINES = 2; // Lines reserved for the message itself and potential padding @@ -322,6 +324,8 @@ const RenderCodeBlockInternal: React.FC<RenderCodeBlockProps> = ({ lang, availableTerminalHeight, terminalWidth - CODE_BLOCK_PREFIX_PADDING, + undefined, + settings, ); return ( <Box paddingLeft={CODE_BLOCK_PREFIX_PADDING} flexDirection="column"> @@ -338,6 +342,8 @@ const RenderCodeBlockInternal: React.FC<RenderCodeBlockProps> = ({ lang, availableTerminalHeight, terminalWidth - CODE_BLOCK_PREFIX_PADDING, + undefined, + settings, ); return ( |
