@@ -436,9 +436,9 @@ public override void OnDrawContent (Rectangle viewport)
436
436
Source . Position = _displayStart ;
437
437
int n = _source ! . Read ( data , 0 , data . Length ) ;
438
438
439
- Attribute activeColor = GetHotNormalColor ( ) ;
440
- Attribute trackingColor = GetHotFocusColor ( ) ;
441
-
439
+ Attribute selectedAttribute = GetHotNormalColor ( ) ;
440
+ Attribute editedAttribute = new Attribute ( GetNormalColor ( ) . Foreground . GetHighlightColor ( ) , GetNormalColor ( ) . Background ) ;
441
+ Attribute editingAttribute = new Attribute ( GetFocusColor ( ) . Background , GetFocusColor ( ) . Foreground ) ;
442
442
for ( var line = 0 ; line < viewport . Height ; line ++ )
443
443
{
444
444
Rectangle lineRect = new ( 0 , line , viewport . Width , 1 ) ;
@@ -449,7 +449,7 @@ public override void OnDrawContent (Rectangle viewport)
449
449
}
450
450
451
451
Move ( 0 , line ) ;
452
- currentAttribute = GetHotNormalColor ( ) ;
452
+ currentAttribute = new Attribute ( GetNormalColor ( ) . Foreground . GetHighlightColor ( ) , GetNormalColor ( ) . Background ) ;
453
453
Driver . SetAttribute ( currentAttribute ) ;
454
454
var address = $ "{ _displayStart + line * nBlocks * NUM_BYTES_PER_HEX_COLUMN : x8} ";
455
455
Driver . AddStr ( $ "{ address . Substring ( 8 - AddressWidth ) } ") ;
@@ -468,13 +468,14 @@ public override void OnDrawContent (Rectangle viewport)
468
468
int offset = line * nBlocks * NUM_BYTES_PER_HEX_COLUMN + block * NUM_BYTES_PER_HEX_COLUMN + b ;
469
469
byte value = GetData ( data , offset , out bool edited ) ;
470
470
471
- if ( offset + _displayStart == Address || edited )
471
+ if ( offset + _displayStart == Address )
472
472
{
473
- SetAttribute ( _leftSideHasFocus ? activeColor : trackingColor ) ;
473
+ // Selected
474
+ SetAttribute ( _leftSideHasFocus ? editingAttribute : ( edited ? editedAttribute : selectedAttribute ) ) ;
474
475
}
475
476
else
476
477
{
477
- SetAttribute ( GetNormalColor ( ) ) ;
478
+ SetAttribute ( edited ? editedAttribute : GetNormalColor ( ) ) ;
478
479
}
479
480
480
481
Driver . AddStr ( offset >= n && ! edited ? " " : $ "{ value : x2} ") ;
@@ -485,9 +486,9 @@ public override void OnDrawContent (Rectangle viewport)
485
486
Driver . AddStr ( block + 1 == nBlocks ? " " : $ "{ _columnSeparatorRune } ") ;
486
487
}
487
488
488
- for ( var bitem = 0 ; bitem < nBlocks * NUM_BYTES_PER_HEX_COLUMN ; bitem ++ )
489
+ for ( var byteIndex = 0 ; byteIndex < nBlocks * NUM_BYTES_PER_HEX_COLUMN ; byteIndex ++ )
489
490
{
490
- int offset = line * nBlocks * NUM_BYTES_PER_HEX_COLUMN + bitem ;
491
+ int offset = line * nBlocks * NUM_BYTES_PER_HEX_COLUMN + byteIndex ;
491
492
byte b = GetData ( data , offset , out bool edited ) ;
492
493
Rune c ;
493
494
@@ -525,20 +526,21 @@ public override void OnDrawContent (Rectangle viewport)
525
526
}
526
527
}
527
528
528
- if ( offset + _displayStart == Address || edited )
529
+ if ( offset + _displayStart == Address )
529
530
{
530
- SetAttribute ( _leftSideHasFocus ? trackingColor : activeColor ) ;
531
+ // Selected
532
+ SetAttribute ( _leftSideHasFocus ? editingAttribute : ( edited ? editedAttribute : selectedAttribute ) ) ;
531
533
}
532
534
else
533
535
{
534
- SetAttribute ( GetNormalColor ( ) ) ;
536
+ SetAttribute ( edited ? editedAttribute : GetNormalColor ( ) ) ;
535
537
}
536
538
537
539
Driver . AddRune ( c ) ;
538
540
539
541
for ( var i = 1 ; i < utf8BytesConsumed ; i ++ )
540
542
{
541
- bitem ++ ;
543
+ byteIndex ++ ;
542
544
Driver . AddRune ( _periodCharRune ) ;
543
545
}
544
546
}
0 commit comments