File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -1479,7 +1479,7 @@ fn compute_color_swatches_for_view(
1479
1479
swatches. sort_by_key ( |inlay_hint| inlay_hint. range . start ) ;
1480
1480
1481
1481
let mut color_swatches = Vec :: with_capacity ( swatches. len ( ) ) ;
1482
- // let mut color_swatches_padding = Vec::with_capacity(swatches.len());
1482
+ let mut color_swatches_padding = Vec :: with_capacity ( swatches. len ( ) ) ;
1483
1483
let mut colors = Vec :: with_capacity ( swatches. len ( ) ) ;
1484
1484
1485
1485
let doc_text = doc. text ( ) ;
@@ -1492,7 +1492,8 @@ fn compute_color_swatches_for_view(
1492
1492
continue ;
1493
1493
} ;
1494
1494
1495
- color_swatches. push ( InlineAnnotation :: new ( swatch_index, "■ " ) ) ;
1495
+ color_swatches. push ( InlineAnnotation :: new ( swatch_index, "■" ) ) ;
1496
+ color_swatches_padding. push ( InlineAnnotation :: new ( swatch_index, " " ) ) ;
1496
1497
colors. push ( Color :: Rgb (
1497
1498
( swatch. color . red * 255. ) as u8 ,
1498
1499
( swatch. color . green * 255. ) as u8 ,
@@ -1506,6 +1507,7 @@ fn compute_color_swatches_for_view(
1506
1507
id : new_doc_color_swatches_id,
1507
1508
colors,
1508
1509
color_swatches,
1510
+ color_swatches_padding,
1509
1511
} ,
1510
1512
) ;
1511
1513
Original file line number Diff line number Diff line change @@ -283,6 +283,7 @@ pub struct DocumentColorSwatches {
283
283
pub id : ColorSwatchesId ,
284
284
285
285
pub color_swatches : Vec < InlineAnnotation > ,
286
+ pub color_swatches_padding : Vec < InlineAnnotation > ,
286
287
pub colors : Vec < Color > ,
287
288
}
288
289
@@ -292,6 +293,7 @@ impl DocumentColorSwatches {
292
293
Self {
293
294
id,
294
295
color_swatches : Vec :: new ( ) ,
296
+ color_swatches_padding : Vec :: new ( ) ,
295
297
colors : Vec :: new ( ) ,
296
298
}
297
299
}
@@ -1470,9 +1472,11 @@ impl Document {
1470
1472
id : _,
1471
1473
colors : _,
1472
1474
color_swatches,
1475
+ color_swatches_padding,
1473
1476
} = text_annotation;
1474
1477
1475
1478
apply_inlay_hint_changes ( color_swatches) ;
1479
+ apply_inlay_hint_changes ( color_swatches_padding) ;
1476
1480
}
1477
1481
1478
1482
helix_event:: dispatch ( DocumentDidChange {
Original file line number Diff line number Diff line change @@ -485,13 +485,12 @@ impl View {
485
485
id : _,
486
486
colors : _,
487
487
color_swatches,
488
+ color_swatches_padding,
488
489
} ) = doc. color_swatches . get ( & self . id )
489
490
{
490
- let type_style = theme
491
- . and_then ( |t| t. find_scope_index ( "ui.background" ) )
492
- . map ( Highlight ) ;
493
-
494
- text_annotations. add_inline_annotations ( color_swatches, type_style) ;
491
+ text_annotations
492
+ . add_inline_annotations ( color_swatches, None )
493
+ . add_inline_annotations ( color_swatches_padding, None ) ;
495
494
} ;
496
495
let config = doc. config . load ( ) ;
497
496
let width = self . inner_width ( doc) ;
You can’t perform that action at this time.
0 commit comments