News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Move Occurrence highlighting from core into a plugin

Started by danselmi, July 29, 2013, 11:22:39 PM

Previous topic - Next topic

Jenna

Quote from: jens on July 31, 2013, 03:04:01 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.
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);

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jenna


Jenna

Any comments, issues or whatever ?

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

MortenMacFly

Quote from: jens on August 06, 2013, 10:31:56 PM
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]