File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/vs/workbench/contrib/inlineChat/browser Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -252,10 +252,13 @@ export class InlineChatLivePreviewWidget extends ZoneWidget {
252
252
return ;
253
253
}
254
254
255
- let hiddenRanges = lineRanges . map ( lineRangeAsRange ) ;
256
- if ( LineRange . fromRange ( hiddenRanges . reduce ( Range . plusRange ) ) . equals ( LineRange . ofLength ( 1 , editor . getModel ( ) . getLineCount ( ) ) ) ) {
257
- // TODO not every line can be hidden, keep the first line around
255
+ let hiddenRanges : Range [ ] ;
256
+ const hiddenLinesCount = lineRanges . reduce ( ( p , c ) => p + c . length , 0 ) ; // assumes no overlap
257
+ if ( hiddenLinesCount >= editor . getModel ( ) . getLineCount ( ) ) {
258
+ // TODO: not every line can be hidden, keep the first line around
258
259
hiddenRanges = [ editor . getModel ( ) . getFullModelRange ( ) . delta ( 1 ) ] ;
260
+ } else {
261
+ hiddenRanges = lineRanges . map ( lineRangeAsRange ) ;
259
262
}
260
263
editor . setHiddenAreas ( hiddenRanges , InlineChatLivePreviewWidget . _hideId ) ;
261
264
this . _logService . debug ( `[IE] diff HIDING ${ hiddenRanges } for ${ editor . getId ( ) } with ${ String ( editor . getModel ( ) ?. uri ) } ` ) ;
You can’t perform that action at this time.
0 commit comments