@@ -64,7 +64,7 @@ import { getSimpleEditorOptions } from '../../codeEditor/browser/simpleEditorOpt
64
64
import { IMarkdownVulnerability } from '../common/annotations.js' ;
65
65
import { ChatContextKeys } from '../common/chatContextKeys.js' ;
66
66
import { IChatResponseModel , IChatTextEditGroup } from '../common/chatModel.js' ;
67
- import { IChatResponseViewModel , isResponseVM } from '../common/chatViewModel.js' ;
67
+ import { IChatResponseViewModel , isRequestVM , isResponseVM } from '../common/chatViewModel.js' ;
68
68
import { ChatTreeItem } from './chat.js' ;
69
69
import { IChatRendererDelegate } from './chatListRenderer.js' ;
70
70
import { ChatEditorOptions } from './chatOptions.js' ;
@@ -370,7 +370,7 @@ export class CodeBlockPart extends Disposable {
370
370
} ;
371
371
}
372
372
373
- layout ( width : number ) : void {
373
+ layout ( width : number , isRequest ?: boolean ) : void {
374
374
const contentHeight = this . getContentHeight ( ) ;
375
375
376
376
let height = contentHeight ;
@@ -380,7 +380,7 @@ export class CodeBlockPart extends Disposable {
380
380
381
381
const editorBorder = 2 ;
382
382
width = width - editorBorder - ( this . currentCodeBlockData ?. renderOptions ?. reserveWidth ?? 0 ) ;
383
- this . editor . layout ( { width, height } ) ;
383
+ this . editor . layout ( { width : isRequest ? width * 0.9 : width , height } ) ;
384
384
this . updatePaddingForLayout ( ) ;
385
385
}
386
386
@@ -402,7 +402,7 @@ export class CodeBlockPart extends Disposable {
402
402
if ( this . getEditorOptionsFromConfig ( ) . wordWrap === 'on' ) {
403
403
// Initialize the editor with the new proper width so that getContentHeight
404
404
// will be computed correctly in the next call to layout()
405
- this . layout ( width ) ;
405
+ this . layout ( width , isRequestVM ( data . element ) ) ;
406
406
}
407
407
408
408
await this . updateEditor ( data ) ;
@@ -419,7 +419,7 @@ export class CodeBlockPart extends Disposable {
419
419
ariaLabel : localize ( 'chat.codeBlockLabel' , "Code block {0}" , data . codeBlockIndex + 1 ) ,
420
420
} ) ;
421
421
}
422
- this . layout ( width ) ;
422
+ this . layout ( width , isRequestVM ( data . element ) ) ;
423
423
this . toolbar . setAriaLabel ( localize ( 'chat.codeBlockToolbarLabel' , "Code block {0}" , data . codeBlockIndex + 1 ) ) ;
424
424
if ( data . renderOptions ?. hideToolbar ) {
425
425
dom . hide ( this . toolbar . getElement ( ) ) ;
0 commit comments