albert1017 / coffee-bytes

Automatically exported from code.google.com/p/coffee-bytes
0 stars 0 forks source link

Improve Last Line Filtering #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Could I propose some improvement regarding 'Last Line
Filtering'?
In my java code I have both types of code:
First:
try {
//
if(condition1) {
//
} else if(condition2) {
//
} else {
//
}
//
try {
//
} catch( Exception x) {
//
}finally {
//
}
} catch (Exception1 e) {
//
} catch (Exception2 e) {
//
} catch (Exception3 e) {
//
}

Second:
try {
//
if(condition1) {
//
}
//
if(condition2) {
//
}
//
try {
//
} catch( Exception x) {
//
}
} catch (Exception1 e) {
//
}

If I disable 'Last Line Filtering' options in folding
preferences then lines with 'else if', 'else' and
'catch' are folded in first example, and closing
brackets are folded in both examples.
If I enable 'Last Line Filtering' options in folding
preferences then lines with 'else if', 'else' and
'catch' aren't folded in first example, and closing
brackets aren't folded in both examples.
Is it possible to fold last line only if there is no
other statement after end of folding block? Like this:
First:
try {
//
if(condition1) { [...]
} else if(condition2) { [...]
} else { [...]
//
try { [...]
} catch( Exception x) { [...]
}finally { [...]
} catch (Exception1 e) { [...]
} catch (Exception2 e) { [...]
} catch (Exception3 e) { [...]

Second:
try {
//
if(condition1) { [...]
//
if(condition2) { [...]
//
try { [...]
} catch( Exception x) { [...]
} catch (Exception1 e) { [...]
So lines with 'else if', 'else' and 'catch' won't be
folded, and closing brackets without other stetements
will be folded.

Original issue reported on code.google.com by rjlori...@gmail.com on 20 Oct 2006 at 9:43