Author Topic: Move Occurrence highlighting from core into a plugin  (Read 18399 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Move Occurrence highlighting from core into a plugin
« Reply #15 on: July 31, 2013, 10:56:32 am »
There is one issue with permanently highlighting.

The highlighting will occurr (most of the times) first after clicking into the file (if it is already opened and not the active one).
It's the same when permanently highlighting is turned off for a word: in actual file highlighting is removed immediately, in open files it is removed after clicking into the file at any place.

I can look into it tomorrow, if you want.

This patch fixes it for me on linux.
I did not (yet) test the whole stuff on windows, so it might be a (wx)scintilla on linux/gtk issue only.
Code
Index: src/plugins/occurrenceshighlighting/highlighter.cpp
===================================================================
--- src/plugins/occurrenceshighlighting/highlighter.cpp
+++ src/plugins/occurrenceshighlighting/highlighter.cpp
@@ -33,7 +33,8 @@
     if ( Manager::Get()->GetEditorManager()->GetActiveEditor() != ctrl  ) return;
 
     // check the event type if it is an update event
-    if ( event.GetEventType() == wxEVT_SCI_UPDATEUI )
+    if ( event.GetEventType() == wxEVT_SCI_UPDATEUI ||
+         event.GetEventType() == wxEVT_SCI_PAINTED)
     {
         HighlightOccurrencesOfSelection(ctrl);
         OnEditorUpdateUI(ctrl);

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Move Occurrence highlighting from core into a plugin
« Reply #16 on: August 01, 2013, 09:04:46 am »
Next updated patch.
This one applies safely for me. I believe it covers 2+3?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Move Occurrence highlighting from core into a plugin
« Reply #17 on: August 01, 2013, 10:00:13 am »
Next updated patch.
This one applies safely for me. I believe it covers 2+3?
Yes, it does.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Move Occurrence highlighting from core into a plugin
« Reply #18 on: August 06, 2013, 10:31:56 pm »
Any comments, issues or whatever ?

I personally think it should be committed to trunk, if everything works as expected.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Move Occurrence highlighting from core into a plugin
« Reply #19 on: August 07, 2013, 07:26:08 am »
Any comments, issues or whatever ?
Go ahead - works fine for me since day 1 posted here.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ