IDEA-53596 Soft wrap for editors

1, Changed recursion to explicit loop;
2. Defined more general handler for reflection-based processing;
This commit is contained in:
Denis Zhdanov
2010-08-18 15:49:59 +04:00
parent ff851e05d8
commit ce078016b9
2 changed files with 15 additions and 15 deletions
@@ -114,7 +114,7 @@ public class SpellCheckAwareEditorFieldProviderImpl implements SpellCheckAwareEd
LocalInspectionTool tool = inspectionClass.newInstance();
tools.put(tool.getShortName(), tool);
}
catch (Exception e) {
catch (Throwable e) {
return null;
}
}
@@ -579,16 +579,16 @@ public class SoftWrapDataMapper {
@Nullable
public TextChange get() {
if (myIndex < 0 || myIndex >= mySoftWraps.size()) {
if (myIndex < 0) {
return null;
}
TextChange result = mySoftWraps.get(myIndex++);
if (isVisible(result)) {
return result;
}
else {
return get();
while (myIndex < mySoftWraps.size()) {
TextChange result = mySoftWraps.get(myIndex++);
if (isVisible(result)) {
return result;
}
}
return null;
}
}
@@ -603,16 +603,16 @@ public class SoftWrapDataMapper {
@Nullable
public FoldRegion get() {
if (myFoldRegions == null || myIndex < 0 || myIndex >= myFoldRegions.length) {
if (myFoldRegions == null || myIndex < 0) {
return null;
}
FoldRegion result = myFoldRegions[myIndex++];
if (result.isExpanded()) {
return get();
}
else {
return result;
while (myIndex < myFoldRegions.length) {
FoldRegion result = myFoldRegions[myIndex++];
if (result.isExpanded()) {
return get();
}
}
return null;
}
}
}