@@ -15,15 +15,13 @@ import { ViewContext } from 'vs/editor/common/viewModel/viewContext';
15
15
export class DecorationsOverlay extends DynamicViewOverlay {
16
16
17
17
private readonly _context : ViewContext ;
18
- private _lineHeight : number ;
19
18
private _typicalHalfwidthCharacterWidth : number ;
20
19
private _renderResult : string [ ] | null ;
21
20
22
21
constructor ( context : ViewContext ) {
23
22
super ( ) ;
24
23
this . _context = context ;
25
24
const options = this . _context . configuration . options ;
26
- this . _lineHeight = options . get ( EditorOption . lineHeight ) ;
27
25
this . _typicalHalfwidthCharacterWidth = options . get ( EditorOption . fontInfo ) . typicalHalfwidthCharacterWidth ;
28
26
this . _renderResult = null ;
29
27
@@ -40,7 +38,6 @@ export class DecorationsOverlay extends DynamicViewOverlay {
40
38
41
39
public override onConfigurationChanged ( e : viewEvents . ViewConfigurationChangedEvent ) : boolean {
42
40
const options = this . _context . configuration . options ;
43
- this . _lineHeight = options . get ( EditorOption . lineHeight ) ;
44
41
this . _typicalHalfwidthCharacterWidth = options . get ( EditorOption . fontInfo ) . typicalHalfwidthCharacterWidth ;
45
42
return true ;
46
43
}
@@ -116,7 +113,6 @@ export class DecorationsOverlay extends DynamicViewOverlay {
116
113
}
117
114
118
115
private _renderWholeLineDecorations ( ctx : RenderingContext , decorations : ViewModelDecoration [ ] , output : string [ ] ) : void {
119
- const lineHeight = String ( this . _lineHeight ) ;
120
116
const visibleStartLineNumber = ctx . visibleRange . startLineNumber ;
121
117
const visibleEndLineNumber = ctx . visibleRange . endLineNumber ;
122
118
@@ -130,9 +126,7 @@ export class DecorationsOverlay extends DynamicViewOverlay {
130
126
const decorationOutput = (
131
127
'<div class="cdr '
132
128
+ d . options . className
133
- + '" style="left:0;width:100%;height:'
134
- + lineHeight
135
- + 'px;"></div>'
129
+ + '" style="left:0;width:100%;"></div>'
136
130
) ;
137
131
138
132
const startLineNumber = Math . max ( d . range . startLineNumber , visibleStartLineNumber ) ;
@@ -145,7 +139,6 @@ export class DecorationsOverlay extends DynamicViewOverlay {
145
139
}
146
140
147
141
private _renderNormalDecorations ( ctx : RenderingContext , decorations : ViewModelDecoration [ ] , output : string [ ] ) : void {
148
- const lineHeight = String ( this . _lineHeight ) ;
149
142
const visibleStartLineNumber = ctx . visibleRange . startLineNumber ;
150
143
151
144
let prevClassName : string | null = null ;
@@ -176,7 +169,7 @@ export class DecorationsOverlay extends DynamicViewOverlay {
176
169
177
170
// flush previous decoration
178
171
if ( prevClassName !== null ) {
179
- this . _renderNormalDecoration ( ctx , prevRange ! , prevClassName , prevShouldFillLineOnLineBreak , prevShowIfCollapsed , lineHeight , visibleStartLineNumber , output ) ;
172
+ this . _renderNormalDecoration ( ctx , prevRange ! , prevClassName , prevShouldFillLineOnLineBreak , prevShowIfCollapsed , visibleStartLineNumber , output ) ;
180
173
}
181
174
182
175
prevClassName = className ;
@@ -186,11 +179,11 @@ export class DecorationsOverlay extends DynamicViewOverlay {
186
179
}
187
180
188
181
if ( prevClassName !== null ) {
189
- this . _renderNormalDecoration ( ctx , prevRange ! , prevClassName , prevShouldFillLineOnLineBreak , prevShowIfCollapsed , lineHeight , visibleStartLineNumber , output ) ;
182
+ this . _renderNormalDecoration ( ctx , prevRange ! , prevClassName , prevShouldFillLineOnLineBreak , prevShowIfCollapsed , visibleStartLineNumber , output ) ;
190
183
}
191
184
}
192
185
193
- private _renderNormalDecoration ( ctx : RenderingContext , range : Range , className : string , shouldFillLineOnLineBreak : boolean , showIfCollapsed : boolean , lineHeight : string , visibleStartLineNumber : number , output : string [ ] ) : void {
186
+ private _renderNormalDecoration ( ctx : RenderingContext , range : Range , className : string , shouldFillLineOnLineBreak : boolean , showIfCollapsed : boolean , visibleStartLineNumber : number , output : string [ ] ) : void {
194
187
const linesVisibleRanges = ctx . linesVisibleRangesForRange ( range , /*TODO@Alex*/ className === 'findMatch' ) ;
195
188
if ( ! linesVisibleRanges ) {
196
189
return ;
@@ -222,12 +215,12 @@ export class DecorationsOverlay extends DynamicViewOverlay {
222
215
+ className
223
216
+ '" style="left:'
224
217
+ String ( visibleRange . left )
218
+ + 'px;width:'
225
219
+ ( expandToLeft ?
226
- 'px;width: 100%;height: ' :
227
- ( 'px;width:' + String ( visibleRange . width ) + 'px;height: ' )
220
+ '100%;' :
221
+ ( String ( visibleRange . width ) + 'px;' )
228
222
)
229
- + lineHeight
230
- + 'px;"></div>'
223
+ + '"></div>'
231
224
) ;
232
225
output [ lineIndex ] += decorationOutput ;
233
226
}
0 commit comments