News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

ThreadSearch preview syntax highlighting

Started by Quiss, October 10, 2018, 01:38:47 PM

Previous topic - Next topic

Quiss

Hi,

ThreadSearch preview editor always uses default highlighting even if you use different color theme (Settings-Editor-Syntax highlighting-Color theme). Also it doesn't check "Highlight wxSmith sections differently" in Settings-Editor-General Settings-C/C++ Editor settings.
src/plugins/contrib/ThreadSearch/ThreadSearchView.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/plugins/contrib/ThreadSearch/ThreadSearchView.cpp b/src/plugins/contrib/ThreadSearch/ThreadSearchView.cpp
index 890bc9756..3e99df2f9 100644
--- a/src/plugins/contrib/ThreadSearch/ThreadSearchView.cpp
+++ b/src/plugins/contrib/ThreadSearch/ThreadSearchView.cpp
@@ -532,12 +532,13 @@ bool ThreadSearchView::UpdatePreview(const wxString& file, long line)

         // Colorize
         cbEditor::ApplyStyles(m_pSearchPreview);
-        EditorColourSet EdColSet;
+        EditorColourSet EdColSet(Manager::Get()->GetEditorManager()->GetColourSet()->GetName());
         EdColSet.Apply(EdColSet.GetLanguageForFilename(m_PreviewFilePath), m_pSearchPreview, false,
                        true);

         SetFoldingIndicator(mgr->ReadInt(_T("/folding/indicator"), 2));
         UnderlineFoldedLines(mgr->ReadBool(_T("/folding/underline_folded_line"), true));
+        m_pSearchPreview->SetProperty(_T("highlight.wxsmith"), mgr->ReadBool(_T("/highlight_wxsmith"), true) ? _T("1") : _T("0"));
     }

     if ( success == true )

My question is where should we get theme name? Like above, by EditorManager or ConfigManager?

oBFusCATed

Huh, someone used this mode for something... I was considering its removal in my plans to cleanup the search experience in C::B :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Quiss

Removal of what; color themes or code duplication in ThreadSearchView?

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Quiss

I think preview is very useful. After thread search, I check from preview if it's the section I'm searching for. And then I double click and open the related file. Without preview, it would be an open-not related-close file loop, time consuming.