mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+14
-14
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user