Skip to content

Commit 3c9476a

Browse files
authored
Merge pull request #260849 from microsoft/copilot/fix-260806
Fix disclaimer word wrapping by preserving normal spaces instead of non-breaking spaces
2 parents 92b442b + 8d835ab commit 3c9476a

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolSubPart.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,11 @@ export class TerminalConfirmationWidgetSubPart extends BaseChatToolInvocationSub
228228
}
229229

230230
private _appendMarkdownPart(container: HTMLElement, message: string | IMarkdownString, codeBlockRenderOptions: ICodeBlockRenderOptions) {
231-
const part = this._register(this.instantiationService.createInstance(ChatMarkdownContentPart, {
232-
kind: 'markdownContent',
233-
content: typeof message === 'string' ? new MarkdownString().appendText(message) : message
234-
},
231+
const part = this._register(this.instantiationService.createInstance(ChatMarkdownContentPart,
232+
{
233+
kind: 'markdownContent',
234+
content: typeof message === 'string' ? new MarkdownString().appendMarkdown(message) : message
235+
},
235236
this.context,
236237
this.editorPool,
237238
false,

src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,21 @@ export class ToolConfirmationSubPart extends BaseChatToolInvocationSubPart {
316316
}
317317

318318
private _makeMarkdownPart(container: HTMLElement, message: string | IMarkdownString, codeBlockRenderOptions: ICodeBlockRenderOptions) {
319-
const part = this._register(this.instantiationService.createInstance(ChatMarkdownContentPart, { kind: 'markdownContent', content: typeof message === 'string' ? new MarkdownString().appendText(message) : message }, this.context, this.editorPool, false, this.codeBlockStartIndex, this.renderer, undefined, this.currentWidthDelegate(), this.codeBlockModelCollection, { codeBlockRenderOptions }));
319+
const part = this._register(this.instantiationService.createInstance(ChatMarkdownContentPart,
320+
{
321+
kind: 'markdownContent',
322+
content: typeof message === 'string' ? new MarkdownString().appendMarkdown(message) : message
323+
},
324+
this.context,
325+
this.editorPool,
326+
false,
327+
this.codeBlockStartIndex,
328+
this.renderer,
329+
undefined,
330+
this.currentWidthDelegate(),
331+
this.codeBlockModelCollection,
332+
{ codeBlockRenderOptions }
333+
));
320334
renderFileWidgets(part.domNode, this.instantiationService, this.chatMarkdownAnchorService, this._store);
321335
container.append(part.domNode);
322336

0 commit comments

Comments
 (0)