@@ -699,19 +699,31 @@ void ResultDock::applyTheme()
699
699
* ---------------------------------------------------------------- */
700
700
S (SCI_INDICSETSTYLE, 0 , INDIC_ROUNDBOX);
701
701
S (SCI_INDICSETFORE, 0 , selBg);
702
- S (SCI_INDICSETALPHA, 0 , 128 );
702
+ // use per‑mode alpha from RDColors
703
+ S (SCI_INDICSETALPHA, 0 ,
704
+ dark ? RDColors::CaretLineAlphaDark
705
+ : RDColors::CaretLineAlphaLight);
706
+ S (SCI_INDICSETALPHA, 0 ,
707
+ dark ? RDColors::CaretLineAlphaDark
708
+ : RDColors::CaretLineAlphaLight);
703
709
S (SCI_INDICSETUNDER, 0 , TRUE );
704
710
705
711
// keep visible (was missing in earlier patch)
706
712
S (SCI_SETCARETLINEVISIBLE, TRUE , 0 );
707
713
S (SCI_SETCARETLINEBACK, selBg, 0 );
714
+ S (SCI_SETCARETLINEVISIBLE, TRUE , 0 );
715
+ S (SCI_SETCARETLINEBACK,
716
+ dark ? selBg
717
+ : RDColors::CaretLineBackLight,
718
+ 0 );
708
719
709
720
/* ----------------------------------------------------------------
710
721
* 6) Custom indicators (colours from RDColors)
711
722
* ---------------------------------------------------------------- */
712
723
COLORREF hitLineBg = dark ? RDColors::LineBgDark : RDColors::LineBgLight;
713
724
COLORREF lineNrFg = dark ? RDColors::LineNrDark : RDColors::LineNrLight;
714
725
COLORREF matchFg = dark ? RDColors::MatchDark : RDColors::MatchLight;
726
+ COLORREF matchBg = RDColors::MatchBgLight;
715
727
COLORREF headerBg = dark ? RDColors::HeaderBgLight : RDColors::HeaderBgLight;
716
728
COLORREF filePathFg = dark ? RDColors::FilePathFgDark : RDColors::FilePathFgLight;
717
729
@@ -726,8 +738,24 @@ void ResultDock::applyTheme()
726
738
S (SCI_INDICSETFORE, INDIC_LINENUMBER_FORE, lineNrFg);
727
739
728
740
/* 6‑c) Match substrings --------------------------------------- */
729
- S (SCI_INDICSETSTYLE, INDIC_MATCH_FORE, INDIC_TEXTFORE);
730
- S (SCI_INDICSETFORE, INDIC_MATCH_FORE, matchFg);
741
+ if (!dark) {
742
+ // configure yellow‑box indicator under the text
743
+ S (SCI_INDICSETSTYLE, INDIC_MATCH_BG, INDIC_FULLBOX);
744
+ S (SCI_INDICSETFORE, INDIC_MATCH_BG, matchBg);
745
+ S (SCI_INDICSETALPHA, INDIC_MATCH_BG, 255 );
746
+ S (SCI_INDICSETUNDER, INDIC_MATCH_BG, TRUE );
747
+
748
+ // configure red‑text indicator
749
+ S (SCI_INDICSETSTYLE, INDIC_MATCH_FORE, INDIC_TEXTFORE);
750
+ S (SCI_INDICSETFORE, INDIC_MATCH_FORE, matchFg);
751
+ }
752
+ else {
753
+ // in Dark‑mode: disable the BG indicator explicitly
754
+ S (SCI_INDICSETALPHA, INDIC_MATCH_BG, 0 );
755
+ // still draw the text in the dark‑mode color
756
+ S (SCI_INDICSETSTYLE, INDIC_MATCH_FORE, INDIC_TEXTFORE);
757
+ S (SCI_INDICSETFORE, INDIC_MATCH_FORE, matchFg);
758
+ }
731
759
732
760
/* 6‑d) Full‑width green header background --------------------- */
733
761
S (SCI_INDICSETSTYLE, INDIC_HEADER_BACKGROUND, INDIC_FULLBOX);
@@ -843,6 +871,14 @@ void ResultDock::applyStyling() const
843
871
h.numberLen );
844
872
845
873
/* 5) Match substrings ------------------------------------------ */
874
+ // first draw the yellow box under each match
875
+ S (SCI_SETINDICATORCURRENT, INDIC_MATCH_BG);
876
+ for (const auto & h : _hits)
877
+ for (size_t i = 0 ; i < h.matchStarts .size (); ++i)
878
+ S (SCI_INDICATORFILLRANGE,
879
+ h.displayLineStart + h.matchStarts [i],
880
+ h.matchLens [i]);
881
+
846
882
S (SCI_SETINDICATORCURRENT, INDIC_MATCH_FORE);
847
883
for (const auto & h : _hits)
848
884
for (size_t i = 0 ; i < h.matchStarts .size (); ++i)
0 commit comments