4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
6
import type { ActivationFunction , OutputItem , RendererContext } from 'vscode-notebook-renderer' ;
7
- import { insertOutput , truncatedArrayOfString } from './textHelper' ;
7
+ import { insertOutput } from './textHelper' ;
8
8
9
9
interface IDisposable {
10
10
dispose ( ) : void ;
@@ -125,7 +125,7 @@ async function renderJavascript(outputInfo: OutputItem, container: HTMLElement,
125
125
domEval ( element ) ;
126
126
}
127
127
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 {
129
129
const element = document . createElement ( 'div' ) ;
130
130
container . appendChild ( element ) ;
131
131
type ErrorLike = Partial < Error > ;
@@ -143,7 +143,7 @@ function renderError(outputInfo: OutputItem, container: HTMLElement, ctx: Render
143
143
stack . classList . add ( 'traceback' ) ;
144
144
stack . style . margin = '8px 0' ;
145
145
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 ) ;
147
147
stack . appendChild ( element ) ;
148
148
container . appendChild ( stack ) ;
149
149
} else {
@@ -196,12 +196,12 @@ function renderStream(outputInfo: OutputItem, container: HTMLElement, error: boo
196
196
}
197
197
}
198
198
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 {
200
200
clearContainer ( container ) ;
201
201
const contentNode = document . createElement ( 'div' ) ;
202
202
contentNode . classList . add ( 'output-plaintext' ) ;
203
203
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 ) ;
205
205
container . appendChild ( contentNode ) ;
206
206
}
207
207
@@ -217,6 +217,8 @@ export const activate: ActivationFunction<void> = (ctx) => {
217
217
.output-plaintext,
218
218
.output-stream,
219
219
.traceback {
220
+ display: inline-block;
221
+ width: 100%;
220
222
line-height: var(--notebook-cell-output-line-height);
221
223
font-family: var(--notebook-cell-output-font-family);
222
224
white-space: pre-wrap;
@@ -228,21 +230,17 @@ export const activate: ActivationFunction<void> = (ctx) => {
228
230
-ms-user-select: text;
229
231
cursor: auto;
230
232
}
231
- span.output-stream {
232
- display: inline-block;
233
- width: 100%;
234
- }
235
- span.output-stream.scrollable {
233
+ .output > span.scrollable {
236
234
overflow-y: scroll;
237
235
max-height: var(--notebook-cell-output-max-height);
238
236
}
239
- span.output-stream.more-above {
237
+ .output > span.output-stream.more-above {
240
238
box-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset
241
239
}
242
- span.output-stream.more-below {
240
+ .output > span.output-stream.more-below {
243
241
box-shadow: var(--vscode-scrollbar-shadow) 0px -6px 6px -6px inset
244
242
}
245
- span.output-stream.more-above.more-below {
243
+ .output > span.output-stream.more-above.more-below {
246
244
box-shadow: var(--vscode-scrollbar-shadow) 0px -6px 6px -6px inset, var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset
247
245
}
248
246
.output-plaintext .code-bold,
0 commit comments