void () { EditorColorsScheme colorsScheme = myEditor.getColorsScheme(); StringBuilder sb = new StringBuilder(); String nn = "\n\n"; String n = "\n"; sb.append(VcsBundle.message("vcs.preview.panel.deleted.line.below")).append(nn) .append(VcsBundle.message("vcs.preview.panel.modified.line")).append(nn) .append(VcsBundle.message("vcs.preview.panel.added.line")).append(nn) .append(VcsBundle.message("vcs.preview.panel.line.with.modified.whitespaces")).append(nn) .append(VcsBundle.message("vcs.preview.panel.added.line")).append(n) .append(VcsBundle.message("vcs.preview.panel.line.with.modified.whitespaces.and.deletion.after")).append(nn) .append(VcsBundle.message("vcs.preview.panel.deleted.ignored.line.below")).append(nn) .append(VcsBundle.message("vcs.preview.panel.modified.ignored.line")).append(nn) .append(VcsBundle.message("vcs.preview.panel.added.ignored.line")).append(nn) .append(VcsBundle.message("vcs.preview.panel.last.commit.modified.line")).append(nn); int additionalLines = Math.max(0, AnnotationsSettings.getInstance().getOrderedColors(colorsScheme).size() - StringUtil.countNewLines(sb)); sb.append(StringUtil.repeat(n, additionalLines)); myEditor.getDocument().setText(sb); myEditor.getMarkupModel().removeAllHighlighters(); myEditor.getGutterComponentEx().closeAllAnnotations(); addHighlighter(new Range(1, 1, 0, 1), false, EditorColors.DELETED_LINES_COLOR); addHighlighter(createModifiedRange(2, Range.MODIFIED), false, EditorColors.MODIFIED_LINES_COLOR); addHighlighter(createModifiedRange(4, Range.INSERTED), false, EditorColors.ADDED_LINES_COLOR); addHighlighter(createModifiedRange(6, Range.EQUAL), false, EditorColors.WHITESPACES_MODIFIED_LINES_COLOR); addHighlighter(createModifiedRange(8, Range.INSERTED, Range.EQUAL, Range.DELETED), false, EditorColors.WHITESPACES_MODIFIED_LINES_COLOR); addHighlighter(new Range(12, 12, 0, 1), true, EditorColors.IGNORED_DELETED_LINES_BORDER_COLOR); addHighlighter(createModifiedRange(13, Range.MODIFIED), true, EditorColors.IGNORED_MODIFIED_LINES_BORDER_COLOR); addHighlighter(new Range(15, 16, 0, 0), true, EditorColors.IGNORED_ADDED_LINES_BORDER_COLOR); int lastCommitLine = 17; List<Color> annotationColors = AnnotationsSettings.getInstance().getOrderedColors(colorsScheme); List<Integer> anchorIndexes = AnnotationsSettings.getInstance().getAnchorIndexes(colorsScheme); myEditor.getGutterComponentEx().registerTextAnnotation(new MyTextAnnotationGutterProvider(annotationColors, anchorIndexes, lastCommitLine)); }