File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,15 @@ module.exports = {
4949 this . highlightSelected . onDidRemoveAllMarkers ( ( ) => this . markersDestroyed ( ) )
5050 } ,
5151
52+ destryDecorations ( ) {
53+ for ( let i = 0 , len = this . decorations . length ; i < len ; i ++ ) {
54+ this . decorations [ i ] . destroy ( )
55+ }
56+ } ,
57+
5258 dispose ( ) {
5359 if ( this . decorations ) {
54- this . decorations . forEach ( decoration => decoration . destroy ( ) )
60+ this . destryDecorations ( )
5561 }
5662 this . decorations = null
5763 } ,
@@ -60,17 +66,18 @@ module.exports = {
6066 if ( ! selected ) { selected = false }
6167 const minimap = this . minimap . minimapForEditor ( options . editor )
6268 if ( ! minimap ) { return }
63- let className = 'highlight-selected'
64- if ( selected ) { className += ' selected' }
6569
66- const decoration = minimap . decorateMarker ( options . marker ,
67- { type : 'highlight' , class : className } )
68- this . decorations . push ( decoration )
70+ this . decorations . push (
71+ minimap . decorateMarker ( options . marker , {
72+ type : 'highlight' ,
73+ class : `highlight-selected${ selected ? ' selected' : '' } ` ,
74+ } ) ,
75+ )
6976 } ,
7077
7178 markersDestroyed ( ) {
7279 if ( this . decorations ) {
73- this . decorations . forEach ( decoration => decoration . destroy ( ) )
80+ this . destryDecorations ( )
7481 }
7582 this . decorations = [ ]
7683 } ,
Original file line number Diff line number Diff line change 55@import " ui-variables" ;
66@import " syntax-variables" ;
77
8+ @contain_all : layout size paint style ;
9+
810.minimap .highlight-selected {
11+ contain : @contain_all ;
912 background : @text-color-highlight ;
1013
1114 & .selected {
15+ contain : @contain_all ;
1216 background : fadeout (@text-color-highlight , 50% );
1317 }
1418}
You can’t perform that action at this time.
0 commit comments