do not rewrite file level highlightings

This commit is contained in:
Alexey Kudravtsev
2010-09-24 13:35:57 +04:00
parent 38beb0db79
commit 2e0919f07c
@@ -116,6 +116,8 @@ public class UpdateHighlightersUtil {
int endOffset,
@NotNull Collection<HighlightInfo> highlights,
int group) {
PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document);
cleanFileLevelHighlights(project, group, psiFile);
setHighlightersToEditor(project, document, Collections.singletonMap(new TextRange(startOffset, endOffset), highlights), group);
}
@@ -192,15 +194,12 @@ public class UpdateHighlightersUtil {
assertMarkupConsistent(markup, project);
}
public static void setHighlightersToEditor(@NotNull Project project,
@NotNull Document document,
@NotNull Map<TextRange, Collection<HighlightInfo>> infos,
final int group) {
static void setHighlightersToEditor(@NotNull Project project,
@NotNull Document document,
@NotNull Map<TextRange, Collection<HighlightInfo>> infos,
final int group) {
ApplicationManager.getApplication().assertIsDispatchThread();
PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document);
cleanFileLevelHighlights(project, group, psiFile);
final List<TextRange> ranges = new ArrayList<TextRange>(infos.keySet());
Collections.sort(ranges, BY_START_OFFSET);
//merge intersecting