#3602 jEdit 4.4.2: Still focus on wrong line with folded target

closed-fixed
Evan Wright
5
2011-11-12
2011-11-07
Bosse Iseborn
No

jEdit 4.4.2 with Java 1.6.0-23 on Solaris 10.

I submitted bug report #3406213 describing this problem for 4.4.1. Evan Wright fixed it for 4.4.2, and I tested it at home and was happy. Now that we have finally begun using 4.4.2 at work (and therefore used it more) I have realized that the fix was not perfect. It works much better now than in 4.4.1, but the problem still remains to a lesser degree.

How to reproduce (and note that I have not fully understood when the problem occurs - just adding and removing one or two lines in the very simple example below changes the behaviour):

* Create a new text file with the following contents (dots represent spaces, and the line numbers are for reference only and should not be entered):

1 aaa
2 ..a1
3
4 bbb
5 ..b2

* Select folding mode Indent, and collapse all folds. Only lines 1 and 4 are now visible.
* Place the caret on line 1 and perform "Go to Line" 5.
* The second folding opens so that line 5 is visible (which is good), but it is line 4 that is selected - not line 5 (which is not so good).

Same thing if you enter "b1" in the "incremental search" field (or whatever it is called), or search for it using the "Search & Replace" dialog.

Discussion

  • Evan Wright
    Evan Wright
    2011-11-07

    I can't reproduce your problem. Could you attach a file that exhibits the bad behavior?

     
  • Bosse Iseborn
    Bosse Iseborn
    2011-11-07

    Two folds

     
    Attachments
  • Bosse Iseborn
    Bosse Iseborn
    2011-11-07

    Three folds

     
    Attachments
  • Bosse Iseborn
    Bosse Iseborn
    2011-11-07

    Attached two files, test1.txt and test2.txt. There is no internet connection on the secure net where I usually work, so I had to go through my private laptop. Doing so I found that I cannot reproduce the problem on Win7 with Java 1.6.0-29 (still jEdit 4.4.2).

    test1.txt contains the file I used as example above. In test2.txt I have added a third (ccc+c1) folding.

    On Solaris I get the behaviour as described above for test1. For test2 it works fine to jump to line 5, but jumping to line 8 ("c1") shows the same behaviour as line 5 for test1.

    On Win7, I instead get a different bug. It works fine to jump to any line in both test1 and test2, but here jEdit will also expand unwanted folds. E.g. jumping to line 5 in test1 will also (unnecessarily) expand the aaa fold. In test2 jumping to line 2 or 5 only expands the correct fold, but jumping to line 8 will expand all three folds.

     
  • Evan Wright
    Evan Wright
    2011-11-07

    • assigned_to: kpouer --> evanpw
     
  • Evan Wright
    Evan Wright
    2011-11-12

    Your problem should be fixed with r20308. I believe the difference in behavior between your work and home can be explained by having "collapseFolds" set globally to something nonzero at work. Since this fix won't be available at your work, here's a workaround: this problem only occurs when you're jumping past the last visible line. If you put something unfolded on the last line of the file (like a line comment), you shouldn't have any problems.

     
  • Evan Wright
    Evan Wright
    2011-11-12

    • status: open --> closed-fixed