Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Issue about wxScintilla

<< < (2/3) > >>

ollydbg:
thanks jen for the explanation.
Yes, I found that in coderefactoring.cpp line 131.
There are code snippet

--- Code: ---    // now that list is filled, we'll search
    cbStyledTextCtrl* control = new cbStyledTextCtrl(editor->GetParent(), wxID_ANY, wxDefaultPosition, wxSize(0, 0));

--- End code ---


--- Quote ---Shall I commit it ?
--- End quote ---
I full agree.



Loaden:

--- Quote from: jens on September 30, 2010, 12:01:58 pm ---
--- Quote from: ollydbg on September 30, 2010, 10:56:03 am ---
--- Quote from: MortenMacFly on September 30, 2010, 10:14:52 am ---debugging into the code Loaden mentioned I also get zero always.

--- End quote ---
Confirmed. strange...

--- End quote ---
No, not strange.
The code do not use the cbEditor, but just the cbStyledTextctrl, but without a lexer and without highlighting any code, so GetStyleAt can not return anything but the default value, because the text is not styled.

The following patch should do the trick:

--- Code: ---Index: coderefactoring.cpp
===================================================================
--- coderefactoring.cpp (Revision 6654)
+++ coderefactoring.cpp (Arbeitskopie)
@@ -156,6 +156,9 @@
                 continue; // failed
             control->SetText(detector.GetWxStr());
         }
+        cbEditor::ApplyStyles(control);
+        EditorColourSet EdColSet;
+        EdColSet.Apply(EdColSet.GetLanguageForFilename(files[i]), control);
 
         Find(control, files[i], targetText);
     }

--- End code ---

Shall I commit it ?

--- End quote ---
Thank Jens! :D
I can't solved this issue so long time.
I am very happy to see what is the reason.
Thanks a lot!

But, I am worry about the search performance?
So, I want look into it.

Jenna:
After a quick test with ThreadSearch-plugin and search for wxString, searching is about 25 times slower: ~400ms against ~9800ms .

I just used wxStropWatch and measured the for-loop in SearchInFiles about line 142.

ollydbg:
I think:
the lexer/parser in scintilla is not as fast as CC's parser. So, I'd rather add a function in Parserthread class to do the search. Currently all the comments were skipped in CC's Tokenizer.

MortenMacFly:

--- Quote from: jens on September 30, 2010, 01:28:07 pm ---After a quick test with ThreadSearch-plugin and search for wxString, searching is about 25 times slower: ~400ms against ~9800ms .

--- End quote ---

--- Quote from: ollydbg on September 30, 2010, 01:40:15 pm ---Currently all the comments were skipped in CC's Tokenizer.

--- End quote ---
Which makes me wonder: Wat's the actual purpose of using the styles in scintilla to quey for comments? I mean: This can only be less performant...?!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version