Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
8.2, 9.0, 11.2, 11.3
-
None
-
None
-
Important
Description
First, Jira is pathetic because it cannot even attach a java or zip file:
"JIRA could not attach the file as there was a missing token. Please try attaching the file again."
So I copy the Java file and kindly ask to create a Maven project containing it, otherwise the searches will not work.
How to reproduce:
- Open project Sample class Sample
- Place cursor on line 3 column 37 FLAG_1
- Press [Alt+F7] find Usages
- Click button [Find]
- In results, hit [Enter] on found position which locates at line 9
- On line 9, append a comment to it: "// I edited this
This should mark the last edited text location to go back to.
- On line 9, select / highlight partial string "FLAG_" and press [Ctrl+F] Find
- Hit [Enter] [Esc], takes cursor to line 16 FLAG_2
- On first occurrence, [Esc]
- Press [F3] find again, takes cursor to line 16 FLAG_3
- Press [Down] + Highlight line after found text and copy [Ctrl+C]
- [Alt+Back]
Expected behavior:
Should go back to position where the last search started, line 9 with "if(FLAG_1){"
Actual behavior:
Goes back to line 3 which is the position before the position where the search started:
private static final boolean FLAG_1 = true;
So the position where the search started is lost from history.
This is actually quite critical because:
I start the search because I want to find some code that is similar to what I just want to continue coding, as a copy and paste operation. So I suspend my current train of thought. After I have actually found that piece of code, I cannot get back to where I want to paste it to.
Some more background: Because of this scenario of suspended thought, my memory is not sufficient to even remember the condition under which this error occurs because I am already distracted. That, and the fact that my way of thinking is perhaps not unique, rather most people would end up in this trap, that is most likely the reason why this has not been fixed yet.
...
package test.sample;
class Sample{
private static final boolean FLAG_1 = true;
private static final boolean FLAG_2 = true;
private static final boolean FLAG_3 = true;
private void method1(){
if(FLAG_1)
}
private void method2(){
if(FLAG_2){ boolean debug = true; }
if(FLAG_3)
{ boolean debug = true; }}
}