jEdit 4.3.2
Java 1.6.0_22
Ubuntu 10.04
textArea.setCaretPosition(idindex); in the attached bsh macro expands the fold containing the caret position if the fold is collapsed. However,
textArea.goToStartOfLine(false);
textArea.goToNextLine(true);
textArea.goToNextLine(true);
textArea.goToNextLine(true);
select one line when the target fold is collapsed and 3 lines when the target fold is open. Uncommenting
// textArea.expandFold(false);
selects 3 lines as expected both when the target fold is open and when the target fold is closed.
bsh testcase
I can't figure out how to attach a second file so here is the target file corresponding to foldbug.bsh
:folding=indent:collapseFolds=1:
top level
indent line 1
indent line 2
indent line 3
indent line 4
indent line 5
target file for foldbug.bsh
attached foldbug.txt as a file as well
just noticed Sourceforge stripped the leading blanks from the target file in the comments. The last 5 lines should be indented (2 spaces but I don't think exact level matters). The attached foldbug.txt should be correct.