IDEA-80533

This commit is contained in:
Alexey Kudravtsev
2012-02-03 14:34:51 +04:00
parent 66c0d88100
commit 1449cb56f4
2 changed files with 14 additions and 2 deletions
@@ -722,4 +722,16 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
assertNotNull("Package " + name + " not found", aPackage);
return aPackage;
}
protected void delete(@NotNull final Editor editor) {
CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
@Override
public void run() {
EditorActionManager actionManager = EditorActionManager.getInstance();
EditorActionHandler actionHandler = actionManager.getActionHandler(IdeActions.ACTION_EDITOR_DELETE);
actionHandler.execute(editor, DataManager.getInstance().getDataContext());
}
}, "delete", editor.getDocument());
}
}
@@ -253,7 +253,7 @@ public class UpdateHighlightersUtil {
RangeHighlighter highlighter = info.highlighter;
int hiStart = highlighter.getStartOffset();
int hiEnd = highlighter.getEndOffset();
if (!info.fromInjection && (hiEnd <= startOffset || hiStart>=endOffset)) return true; // injections are oblivious to restricting range
if (!info.fromInjection && hiEnd < document.getTextLength() && (hiEnd <= startOffset || hiStart>=endOffset)) return true; // injections are oblivious to restricting range
boolean toRemove = !(hiEnd == document.getTextLength() && range.getEndOffset() == document.getTextLength()) &&
!range.containsRange(hiStart, hiEnd)
;
@@ -277,7 +277,7 @@ public class UpdateHighlightersUtil {
@Override
public boolean process(int offset, HighlightInfo info, boolean atStart, Collection<HighlightInfo> overlappingIntervals) {
if (!atStart) return true;
if (!info.fromInjection && (info.getEndOffset() <= startOffset || info.getStartOffset()>=endOffset)) return true; // injections are oblivious to restricting range
if (!info.fromInjection && info.getEndOffset() < document.getTextLength() && (info.getEndOffset() <= startOffset || info.getStartOffset()>=endOffset)) return true; // injections are oblivious to restricting range
if (info.isFileLevelAnnotation && psiFile != null && psiFile.getViewProvider().isPhysical()) {
addFileLevelHighlight(project, group, info, psiFile);