User forums > Using Code::Blocks

ThreadSearch preview syntax highlighting

(1/1)

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.

--- Code: --- 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 )

--- End code ---
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 :)

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

oBFusCATed:
The code preview in the threadsearch :)

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.

Navigation

[0] Message Index

Go to full version