Skip to content

Commit a28ca80

Browse files
committed
update css selectors
1 parent e6bacb0 commit a28ca80

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

notebook-renderers/src/index.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import type { ActivationFunction, OutputItem, RendererContext } from 'vscode-notebook-renderer';
7-
import { insertOutput, truncatedArrayOfString } from './textHelper';
7+
import { insertOutput } from './textHelper';
88

99
interface IDisposable {
1010
dispose(): void;
@@ -125,7 +125,7 @@ async function renderJavascript(outputInfo: OutputItem, container: HTMLElement,
125125
domEval(element);
126126
}
127127

128-
function renderError(outputInfo: OutputItem, container: HTMLElement, ctx: RendererContext<void> & { readonly settings: { readonly lineLimit: number } }): void {
128+
function renderError(outputInfo: OutputItem, container: HTMLElement, ctx: RendererContext<void> & { readonly settings: RenderOptions }): void {
129129
const element = document.createElement('div');
130130
container.appendChild(element);
131131
type ErrorLike = Partial<Error>;
@@ -143,7 +143,7 @@ function renderError(outputInfo: OutputItem, container: HTMLElement, ctx: Render
143143
stack.classList.add('traceback');
144144
stack.style.margin = '8px 0';
145145
const element = document.createElement('span');
146-
truncatedArrayOfString(outputInfo.id, [err.stack ?? ''], ctx.settings.lineLimit, element);
146+
insertOutput(outputInfo.id, [err.stack ?? ''], ctx.settings.lineLimit, false, element);
147147
stack.appendChild(element);
148148
container.appendChild(stack);
149149
} else {
@@ -196,12 +196,12 @@ function renderStream(outputInfo: OutputItem, container: HTMLElement, error: boo
196196
}
197197
}
198198

199-
function renderText(outputInfo: OutputItem, container: HTMLElement, ctx: RendererContext<void> & { readonly settings: { readonly lineLimit: number } }): void {
199+
function renderText(outputInfo: OutputItem, container: HTMLElement, ctx: RendererContext<void> & { readonly settings: RenderOptions }): void {
200200
clearContainer(container);
201201
const contentNode = document.createElement('div');
202202
contentNode.classList.add('output-plaintext');
203203
const text = outputInfo.text();
204-
truncatedArrayOfString(outputInfo.id, [text], ctx.settings.lineLimit, contentNode);
204+
insertOutput(outputInfo.id, [text], ctx.settings.lineLimit, ctx.settings.outputScrolling, contentNode);
205205
container.appendChild(contentNode);
206206
}
207207

@@ -217,6 +217,8 @@ export const activate: ActivationFunction<void> = (ctx) => {
217217
.output-plaintext,
218218
.output-stream,
219219
.traceback {
220+
display: inline-block;
221+
width: 100%;
220222
line-height: var(--notebook-cell-output-line-height);
221223
font-family: var(--notebook-cell-output-font-family);
222224
white-space: pre-wrap;
@@ -228,21 +230,17 @@ export const activate: ActivationFunction<void> = (ctx) => {
228230
-ms-user-select: text;
229231
cursor: auto;
230232
}
231-
span.output-stream {
232-
display: inline-block;
233-
width: 100%;
234-
}
235-
span.output-stream.scrollable {
233+
.output > span.scrollable {
236234
overflow-y: scroll;
237235
max-height: var(--notebook-cell-output-max-height);
238236
}
239-
span.output-stream.more-above {
237+
.output > span.output-stream.more-above {
240238
box-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset
241239
}
242-
span.output-stream.more-below {
240+
.output > span.output-stream.more-below {
243241
box-shadow: var(--vscode-scrollbar-shadow) 0px -6px 6px -6px inset
244242
}
245-
span.output-stream.more-above.more-below {
243+
.output > span.output-stream.more-above.more-below {
246244
box-shadow: var(--vscode-scrollbar-shadow) 0px -6px 6px -6px inset, var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset
247245
}
248246
.output-plaintext .code-bold,

notebook-renderers/src/textHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function generateViewMoreElement(outputId: string, adjustableSize: boolean) {
3131
return container;
3232
}
3333

34-
export function truncatedArrayOfString(id: string, buffer: string[], linesLimit: number, container: HTMLElement) {
34+
function truncatedArrayOfString(id: string, buffer: string[], linesLimit: number, container: HTMLElement) {
3535
const lineCount = buffer.length;
3636
container.appendChild(generateViewMoreElement(id, true));
3737

0 commit comments

Comments
 (0)