This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Disable automatic "search" highlight

Tags: None
(comma "," separated)
riose
Registered Member
Posts
3
Karma
0

Disable automatic "search" highlight

Fri Jun 12, 2015 10:06 am
KDevelop (Version 4.6.0) automatically highlights all occurrences of text under the cursor. Is there any way to disable this?

I'm using custom theme so the default highlight color is jarring, I do not even seem to find how to change the highlight color.
piotrm
Registered Member
Posts
13
Karma
0
OS
I use KDevelop 4.7.1 and KDE 4.14.5 (Kate with the same version).
I'm not sure if in your version of KDevelop such option is available, but you can try with
Code: Select all
"Configure Editor -> Fonts & Highlights", Tab: "Colors" and here in section "Editor Background Colors" there is an option: "Search Highlight".

For me change selected here color made change "automatically highlights all occurrences of text under the cursor". So if you change this color to the background color of your KDevelop then highlighting seems to be disabled.
riose
Registered Member
Posts
3
Karma
0
[quote="piotrm"]I use KDevelop 4.7.1 and KDE 4.14.5 (Kate with the same version).
Code: Select all
"Configure Editor -> Fonts & Highlights", Tab: "Colors" and here in section "Editor Background Colors" there is an option: "Search Highlight".

At least in 4.6 that setting only changes the highlight color of occurrences when you double click on a text (on C++ source file). This does not affect the hover highlighting or when you move the cursor on the text when editing source.
piotrm
Registered Member
Posts
13
Karma
0
OS
Yes you are right. My mistake :P. In my version it works the same like you write.
But I found properly option which disable refers to highlighting when mouse cursor hovering the word.
In my version this is placed in
Code: Select all
"Configure Editor -> Extension" and calls "Highlight Selection".
I think this is comes from Kate extensions.
Anyway. If I turned off this extension then when I move cursor on the text, it isn't highlighted.
piotrm
Registered Member
Posts
13
Karma
0
OS
Sorry. Again my mistake :-(. Above option refers to
Code: Select all
"Configure Editor -> Fonts & Highlights", Tab: "Colors" and here in section "Editor Background Colors" there is an option: "Search Highlight"
.
Previously I not conducted sufficient tests :-(. Finally in my version there is no option to disable such highlighting as you mentioned. At least I can't find it.
riose
Registered Member
Posts
3
Karma
0
This really seems to be the case.

Annoying little feature, I guess I'll have to see if I get used to it :)
haasosaurus
Registered Member
Posts
1
Karma
0
this issue has been annoying me as well, i just wanted to tell you i found it comes from the code browser plugin, will update if i find a way to disable the highlighting without disabling code browser completely
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
I don't think you can disable the highlight, sorry :(
But configurable colors for all this is a feature request standing for years ...


I'm working on the KDevelop IDE.
User avatar
subdiff
Registered Member
Posts
59
Karma
0
OS
Well, I'll try to give you some more informations: I think the highlighting feature is located in the context browser plugin. But it's not really a "plugin": It's the central class for viewing the contents of the opened documents.

Especially you can see in the two functions
Code: Select all
highlightedUseAttribute()
highlightedSpecialObjectAttribute()

that the colors are hardcoded here. That means you can't change them after compiling. Why is it done this way, when you can change nearly any other color in the settings? Because the colors in the settings are provided by KatePart/KTextEditor, while the mouse hover highlight functionality is some sort of KDevelop's own thing. That's why you can't change it in the settings dialog under Fonts & Colors.

You have two options: Integrate hl functionality on mouse hover in KatePart (difficult and maybe not doable). Implement a switch to deactivate highlighting in KDevelop. It's an uglier solution, but should work without problems. It seems to me the whole updateViews() method only does highlighting. So try deactivating it (setting off the QTimer) and see what happens.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Thanks for finding the place where it's hardcoded, I just wanted to go search for it in the next few days ;)
I think we should just use kate's search highlight color, if we can get that.


I'm working on the KDevelop IDE.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Fix is in, will be in 5.0.1. It now uses the "search highlight" color from kate as background.


I'm working on the KDevelop IDE.
User avatar
subdiff
Registered Member
Posts
59
Karma
0
OS
scummos wrote:Fix is in, will be in 5.0.1. It now uses the "search highlight" color from kate as background.

Yea, great idea to just use Kate's highlighting color value! But will it then look completely the same? I think a little difference between the two highlighting methods would be nice.

Is it maybe possible to always add a small delta to the color code you get from Kate? Just to make it a small nuance brighter/darker?
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Hm yeah, but then you are back again at the situation from before where the user can't really control what it looks like. Also color calculations always have the risk of turning out hard to read ...

Are you sure it's a problem the two look the same? I clicked around a bit and it seemed fine to me. If it turns out to be a problem we can certainly figure something out.


I'm working on the KDevelop IDE.
User avatar
subdiff
Registered Member
Posts
59
Karma
0
OS
The issue I see is with text highlighting in power search (CTRL+R). When you search for a pattern (click Find All) it highlights all occurrences. Then clicking on document and moving your mouse over another word in the text highlights this in the same color. A (small) differentation would be nice in this case (I indeed use the two features sometimes together).

I don't know how the color values are calculated. But if for example there is the possibilty of increasing the brightness without changing the hue wrt the normal search highlighting it could work quite well I believe. Also for users with crazy color template choices. ;)
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
I have done a lot of color calculations in the past, and it's always ... difficult to get it right. Esp. for white and black it's very different how much you have to modify a color in order to get a noticeable difference, and it also depends on screen gamma, etc ... I'd rather not do that here.
I think it would then be better to introduce an additional "Default Text Style" in kate to be used for that purpose.


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]