@@ -399,6 +399,7 @@ export class CommentController implements IEditorContribution {
399
399
this . registerEditorListeners ( ) ;
400
400
this . beginCompute ( ) ;
401
401
} else {
402
+ this . tryUpdateReservedSpace ( ) ;
402
403
this . clearEditorListeners ( ) ;
403
404
this . _commentingRangeDecorator . update ( this . editor , [ ] ) ;
404
405
this . _commentThreadRangeDecorator . update ( this . editor , [ ] ) ;
@@ -949,13 +950,13 @@ export class CommentController implements IEditorContribution {
949
950
return hasRanges || ( info . threads . length > 0 ) ;
950
951
} ) ;
951
952
952
- if ( hasCommentsOrRanges && ! this . _commentingRangeSpaceReserved ) {
953
+ if ( hasCommentsOrRanges && ! this . _commentingRangeSpaceReserved && this . commentService . isCommentingEnabled ) {
953
954
this . _workspaceHasCommenting . set ( true ) ;
954
955
this . _commentingRangeSpaceReserved = true ;
955
956
const { lineDecorationsWidth, extraEditorClassName } = this . getExistingCommentEditorOptions ( this . editor ) ;
956
957
const newOptions = this . getWithCommentsEditorOptions ( this . editor , extraEditorClassName , lineDecorationsWidth ) ;
957
958
this . updateEditorLayoutOptions ( this . editor , newOptions . extraEditorClassName , newOptions . lineDecorationsWidth ) ;
958
- } else if ( ! hasCommentsOrRanges && this . _commentingRangeSpaceReserved ) {
959
+ } else if ( ( ! hasCommentsOrRanges || ! this . commentService . isCommentingEnabled ) && this . _commentingRangeSpaceReserved ) {
959
960
this . _commentingRangeSpaceReserved = false ;
960
961
const { lineDecorationsWidth, extraEditorClassName } = this . getExistingCommentEditorOptions ( this . editor ) ;
961
962
const newOptions = this . getWithoutCommentsEditorOptions ( this . editor , extraEditorClassName , lineDecorationsWidth ) ;
0 commit comments