Author Topic: ThreadSearch preview syntax highlighting  (Read 2484 times)

Offline Quiss

  • Multiple posting newcomer
  • *
  • Posts: 76
ThreadSearch preview syntax highlighting
« on: October 10, 2018, 01:38:47 pm »
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 )
My question is where should we get theme name? Like above, by EditorManager or ConfigManager?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: ThreadSearch preview syntax highlighting
« Reply #1 on: October 10, 2018, 05:21:13 pm »
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!]

Offline Quiss

  • Multiple posting newcomer
  • *
  • Posts: 76
Re: ThreadSearch preview syntax highlighting
« Reply #2 on: October 12, 2018, 07:29:55 am »
Removal of what; color themes or code duplication in ThreadSearchView?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: ThreadSearch preview syntax highlighting
« Reply #3 on: October 12, 2018, 08:18:32 am »
The code preview in the threadsearch :)
(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!]

Offline Quiss

  • Multiple posting newcomer
  • *
  • Posts: 76
Re: ThreadSearch preview syntax highlighting
« Reply #4 on: October 12, 2018, 08:42:44 am »
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.