mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 15:31:27 +00:00
fix: update colorizeCode calls to use new parameter order
The colorizeCode function signature was changed to have tabWidth as the last parameter with a default value. Update all call sites to match. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
2819c7d887
commit
18f9e5ac34
3 changed files with 3 additions and 5 deletions
|
|
@ -125,17 +125,17 @@ export function colorizeLine(
|
|||
*
|
||||
* @param code The code string to highlight.
|
||||
* @param language The language identifier (e.g., 'javascript', 'css', 'html')
|
||||
* @param tabWidth The tabWidth of the language, default is 4
|
||||
* @param tabWidth The number of spaces to replace each tab character with, default is 4
|
||||
* @returns A React.ReactNode containing Ink <Text> elements for the highlighted code.
|
||||
*/
|
||||
export function colorizeCode(
|
||||
code: string,
|
||||
language: string | null,
|
||||
tabWidth = 4,
|
||||
availableHeight?: number,
|
||||
maxWidth?: number,
|
||||
theme?: Theme,
|
||||
settings?: LoadedSettings,
|
||||
tabWidth = 4,
|
||||
): React.ReactNode {
|
||||
const codeToHighlight = code
|
||||
.replace(/\n$/, '')
|
||||
|
|
|
|||
|
|
@ -328,7 +328,6 @@ const RenderCodeBlockInternal: React.FC<RenderCodeBlockProps> = ({
|
|||
const colorizedTruncatedCode = colorizeCode(
|
||||
truncatedContent.join('\n'),
|
||||
lang,
|
||||
4,
|
||||
availableTerminalHeight,
|
||||
contentWidth - CODE_BLOCK_PREFIX_PADDING,
|
||||
undefined,
|
||||
|
|
@ -347,7 +346,6 @@ const RenderCodeBlockInternal: React.FC<RenderCodeBlockProps> = ({
|
|||
const colorizedCode = colorizeCode(
|
||||
fullContent,
|
||||
lang,
|
||||
4,
|
||||
availableTerminalHeight,
|
||||
contentWidth - CODE_BLOCK_PREFIX_PADDING,
|
||||
undefined,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue