I hope I'm missing a setting, otherwise this bug is serious to me (on MacOSX) - losing highlight

One of things I love in ides is the ability to double click to select a var and then it shows all the other instances of that var in scope. IDEA does this UNTIL I start scrolling past the original double-clicked var, at which point it then switches to the next defined var at the top of the screen.

For example, if you have..

int age = 0;
int score = 0;

and you double click on 'age' you'll see all 'age' instances in scope . Now say you initilally selected age while it was in the middle of your view, now start to scroll down the file - As soon as the initial 'age' rolls off the top of the file it switches to highlighting instances of "score" in scope. As I can continue to scroll down it will switch to new definitions as they are declared.

9 comments
Comment actions Permalink

I can see how it's somehow related to the setting "Hightlight on caret movement," since there is a settting "highlight usages of element under caret." Now since the screen scolls down as the screen scrolls past the top the caret then changes to the next line. There needs to be a way to say "highlight my selection in scope" but have it 'stick' until I click on something else. Not sure what setting combo or shortcut combo I can use to mimic the behavior that I want.

0
Comment actions Permalink

Should I submit this as a bug? It seems like it's a bug to me. I can't imagine a user wanting the instance variable highlighted to change to others as you simply scroll down your file.

0
Comment actions Permalink

if I understand your request correctly you could try Search->Highlight usages in file

0
Comment actions Permalink

Hello Rick,

There is no behavior in IDEA that handles double-clicks in such a way. Maybe
this highlighting is provided by a third-party plugin? In that case you should
report this bug to the plugin developer.

IDEA has a similar feature (Settings | Editor | Highlight usages of element
at caret) but it simply highlights occurrences of the variable under caret,
so you simply need to put the caret on the variable to highlight, not double-click
it. And it doesn't react to scrolling in any way.

One of things I love in ides is the ability to double click to select
a var and then it shows all the other instances of that var in scope.
IDEA does this UNTIL I start scrolling past the original
double-clicked var, at which point it then switches to the next
defined var at the top of the screen.

For example, if you have..

int age = 0;
int score = 0;
and you double click on 'age' you'll see all 'age' instances in scope
. Now say you initilally selected age while it was in the middle of
your view, now start to scroll down the file - As soon as the initial
'age' rolls off the top of the file it switches to highlighting
instances of "score" in scop

e. As I can continue to scroll down it will switch to new definitions
as they are declared.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5237533#5237533

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

*SOLVED*
BLAH. I'm a moron. Well not all my fault. I started investigating my plugins.. and it turns out it was the ideaVim plugin as the culprit... even though I wasn't using the pluin. In other words, I had the plugin 'off' but it still affected things.  I forgot I had installed that. I sure feel better I have it back to normal now. That was driving me crazy. ( I need to let the vim plugin author know about the issue though.)

--------- my old post left just for context below ------


Sorry if there was some confusion. It has nothing to do with double click and the issue is seen with the settings as you described above. But it's an issue with that setting that I have a problem with.

The issue is when you have a variable underneath the cursor and you start to scroll down the file, the caret at the top of the file 'moves down' to the next var and thus your highlight is changed.  For example if you have the following simple class:


<pre>
public class HighlighTest {

    public void fooMethod() {

        int testOne = 5;

        int testTwo = 6;

        System.out.println(testOne);


        System.out.println(testTwo);


        System.out.println(testOne);


        System.out.println(testTwo);


        System.out.println(testOne);



    }

       /*


       empty space

... etc so you can scroll
}
</pre>

If you have the caret on the first declaration of "testOne" and you then start scolling the file with the mouse, I'd want the instances that I orginally had the caret on (testOne) to remain highlighted, but that's not what happens... when you scroll the file the caret then moves to "testTwo" next and then you end up with all testTwo instances highlighted. This isn't the behavior I notice in other IDEs so it's a bit frustrating. (Possibly I have some plugin installed that is causing this, but I haven't installed many,)

Here are two images showing what I'm refering to. The first one is with "testOne" highlighted. The second image you can tell I scrolled the file down and the caret jumped to "testTwo" and started highlighting testTwo. Unfortunately the caret is not showing up in the images, but in testOne it's on the testOne var, and in testTwo it's on the testTwo var.



Attachment(s):
testTwo.jpg
testOne.jpg
0
Comment actions Permalink

I'm not sure I understand what you mean, so I try to rephrase it with my words:
- select a variable (e.g. by double clicking it)
- use the mouse wheel to scroll the selection out of the visible area
=> for me the selection remains as expected, it even makes no difference
what is selected

If I did not understand you right, please correct me.

Tom

0
Comment actions Permalink

If you scroll with CTRL-UP and CTRL-DOWN instead of the mousewheel, you see
the problem.

I'm not sure I understand what you mean, so I try to rephrase it with
my words:
- select a variable (e.g. by double clicking it)
- use the mouse wheel to scroll the selection out of the visible area
=> for me the selection remains as expected, it even makes no
difference
what is selected
If I did not understand you right, please correct me.

Tom



0
Comment actions Permalink

If you scroll with CTRL-UP and CTRL-DOWN instead of the mousewheel, you
see the problem.


I'm sure, this is intended to keep the caret in the visible area and avoid
unexpected scrolling if you, for example, would press <cursor-left> or
<cursor-right>.

0
Comment actions Permalink

>> If you scroll with CTRL-UP and CTRL-DOWN instead of the mousewheel,
>> you see the problem.
>>

I'm sure, this is intended to keep the caret in the visible area and
avoid unexpected scrolling if you, for example, would press
<cursor-left> or <cursor-right>.


Perhaps, but it's at odds with scrolling with the mousewheel followed by
pressing LEFT or RIGHT. I prefer the mousewheel behaviour whereby the view
scrolls back to the cursor only if you move the caret or edit. To me it's
counter-intuitive that scrolling with CTRL-UP/DOWN can result in the cursor
being moved. Plus as Rick has pointed out it affects highlighting, which
I find as irritating as he does. Of course I can see that some people probably
prefer the mousewheel behaviour. Either way though, the inconsistency is
a bad thing.


0

Please sign in to leave a comment.