use of com.intellij.openapi.editor.LogicalPosition in project intellij-community by JetBrains.
the class ShowContainerInfoHandler method isDeclarationVisible.
private static boolean isDeclarationVisible(PsiElement container, Editor editor) {
Rectangle viewRect = editor.getScrollingModel().getVisibleArea();
final TextRange range = DeclarationRangeUtil.getPossibleDeclarationAtRange(container);
if (range == null) {
return false;
}
LogicalPosition pos = editor.offsetToLogicalPosition(range.getStartOffset());
Point loc = editor.logicalPositionToXY(pos);
return loc.y >= viewRect.y;
}
use of com.intellij.openapi.editor.LogicalPosition in project intellij-community by JetBrains.
the class PyEditingTest method testGreedyBackspace.
public void testGreedyBackspace() {
// PY-254
final EditorSettingsExternalizable settings = EditorSettingsExternalizable.getInstance();
boolean oldVSpaceValue = settings.isVirtualSpace();
try {
settings.setVirtualSpace(true);
doTestBackspace("py254", new LogicalPosition(4, 8));
} finally {
settings.setVirtualSpace(oldVSpaceValue);
}
}
Aggregations