Variable Highlighting suddenly stops working

I have a reoccurring problem with the variable highlighting. When writing python scripts the feature seemingly randomly stops working as long as the script is in some condition that for whatever reason causes this effect.

The problem was described here as well, but no solution is given:

This is really kinda frustrating. Is there a solution or at least an explanation for this?

Could you share some sample code for us to try and reproduce this?
What OS are you running?
What version of Komodo are you using?
What version of Python are you running?
Once this starts to happen does anything bring it back or does it reach a point then never work again?

  • Carey

I am running win 7 64 bit, Python 2.7, Komodo Edit 8.5

The functionality can be restored, if the code leaves some configuration.

I have found out that it seems to be related to comments. I removed one line of comments after the other from a piece of code and each time checked if the feature would work again. I though could not figure out how exactly the issue is related to the comments.

Also, the issue seems to be local to substructures of the code like loops and functions. I got a scrip where it works inside one function but not inside another one.

At the moment I don’t have code in which the problem is present, as I got rid of it for now in the last script I was working on by removing some comments. And I also cannot recreate the issue, as I don’t know what the conditions are.

FYI, I never made it work reliably. When I need to highlight something I trigger the “Find” bar.

Still, there’re times when I click on a variable and I magically see all instances highlighted (maybe 1 in 100 times). I’ve never been able to find a pattern but I suspect that it’s like all code intelligence features: it requires a lightning fast computer I don’t have.

But it works reliably in other editors. Never had it fail on me with Notepad++ for example.

Two things you should consider are -

  • We only highlight variables, so simply clicking on any random word won’t just highlight occurrences, it has to be a variable
  • By default it only highlights variables in scope

Have a look at these settings under Prefs > Smart Editing (bottom of pref pane)

I moved a post to a new topic: Variable Highlighting scope doesnt handle foreach properly