Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
243,700 | TextChangeImpl () { return myChange; } | getChange |
243,701 | void (int diff) { myChange.advance(diff); } | advance |
243,702 | int () { int result = myChange.hashCode(); result = 31 * result + myIndentInColumns; return 31 * result + myIndentInPixels; } | hashCode |
243,703 | boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SoftWrapImpl that = (SoftWrapImpl)o; return myIndentInColumns == that.myIndentInColumns && myIndentInPixels == that.myIndentInPixels && myChange.equals(that.myChange); } | equals |
243,704 | String () { return myChange.toString(); } | toString |
243,705 | int (@NotNull Graphics g, @NotNull SoftWrapDrawingType drawingType, int x, int y, int lineHeight) { myHeightProvider.myHeight = lineHeight / 2; int start; int end; int result; switch (drawingType) { case BEFORE_SOFT_WRAP_LINE_FEED -> { start = x; end = myEditor.getScrollingModel().getVisibleArea().width; result = end -... | paint |
243,706 | int (@NotNull Graphics g, @NotNull SoftWrapDrawingType drawingType, int x, int y, int lineHeight) { return switch (drawingType) { case BEFORE_SOFT_WRAP_LINE_FEED -> myEditor.getScrollingModel().getVisibleArea().width - x; case AFTER_SOFT_WRAP -> 0; }; } | getDrawingHorizontalOffset |
243,707 | int (@NotNull SoftWrapDrawingType drawingType) { if (myMinWidth < 0) { // We need to reserve a minimal space required for representing arrow before soft wrap-introduced line feed. myMinWidth = EditorUtil.charWidth('a', Font.PLAIN, myEditor); } return myMinWidth; } | getMinDrawingWidth |
243,708 | boolean () { return true; } | canUse |
243,709 | void () { myMinWidth = -1; } | reinit |
243,710 | Integer () { return myHeight; } | compute |
243,711 | Integer () { return EditorUtil.getSpaceWidth(Font.PLAIN, myEditor); } | compute |
243,712 | boolean () { return myWraps.isEmpty(); } | isEmpty |
243,713 | List<SoftWrapImpl> () { return myWrapsView; } | getSoftWraps |
243,714 | int (int offset) { return ObjectUtils.binarySearch(0, myWraps.size(), i -> Integer.compare(myWraps.get(i).getStart(), offset)); } | getSoftWrapIndex |
243,715 | int (int startOffset, int endOffset) { int startIndex = getSoftWrapIndex(startOffset); if (startIndex < 0) { startIndex = -startIndex - 1; } if (startIndex >= myWraps.size()) { return 0; } int result = 0; int endIndex = startIndex; for (; endIndex < myWraps.size(); endIndex++) { SoftWrap softWrap = myWraps.get(endIndex... | getNumberOfSoftWrapsInRange |
243,716 | void (SoftWrapImpl softWrap) { int i = getSoftWrapIndex(softWrap.getStart()); if (i >= 0) { myWraps.set(i, softWrap); return; } i = -i - 1; myWraps.add(i, softWrap); } | storeOrReplace |
243,717 | void (SoftWrapImpl softWrap) { if (myWraps.isEmpty()) return; int i = myWraps.size() - 1; // expected use case is removing of last soft wrap, so we have a fast path here for that case if (myWraps.get(i).getStart() != softWrap.getStart()) { i = getSoftWrapIndex(softWrap.getStart()); } if (i >= 0) { myWraps.remove(i); } ... | remove |
243,718 | List<SoftWrapImpl> (int offset) { int startIndex = getSoftWrapIndex(offset); if (startIndex < 0) { startIndex = -startIndex - 1; } if (startIndex >= myWraps.size()) { return Collections.emptyList(); } List<SoftWrapImpl> tail = myWraps.subList(startIndex, myWraps.size()); List<SoftWrapImpl> result = new ArrayList<>(tail... | removeStartingFrom |
243,719 | void (List<? extends SoftWrapImpl> softWraps) { myWraps.addAll(softWraps); } | addAll |
243,720 | void () { myWraps.clear(); notifyListenersAboutChange(); } | removeAll |
243,721 | boolean (@NotNull SoftWrapChangeListener listener) { return myListeners.add(listener); } | addSoftWrapChangeListener |
243,722 | void () { for (SoftWrapChangeListener listener : myListeners) { listener.softWrapsChanged(); } } | notifyListenersAboutChange |
243,723 | String () { return myWraps.toString(); } | dumpState |
243,724 | boolean (CaretImpl caret) { if (!caret.isUpToDate()) { return false; } EditorImpl editor = caret.getEditor(); SoftWrapModel softWrapModel = editor.getSoftWrapModel(); int offset = caret.getOffset(); SoftWrap softWrap = softWrapModel.getSoftWrap(offset); if (softWrap == null) { return false; } VisualPosition afterWrapPo... | isCaretAfterSoftWrap |
243,725 | boolean () { return myIterationState.atEnd(); } | atEnd |
243,726 | void () { if (myLineBreak) { myLogicalLine++; } else if (isFoldRegion()) { myLogicalLine = myDocument.getLineNumber(getElementEndOffset()); } if (myElementEndOffset < myIterationState.getEndOffset()) { myElementStartOffset = myElementEndOffset; setCharElement(); } else { myIterationState.advance(); setElementOffsets();... | advance |
243,727 | void () { if (myIterationState.atEnd()) return; myElementStartOffset = myIterationState.getStartOffset(); if (myIterationState.getCurrentFold() == null) { setCharElement(); } else { myElementEndOffset = myIterationState.getEndOffset(); myLineBreak = false; } } | setElementOffsets |
243,728 | void () { myElementEndOffset = Character.offsetByCodePoints(myText, myElementStartOffset, 1); myCodePoint = Character.codePointAt(myText, myElementStartOffset); myLineBreak = false; if (myCodePoint == '\n') { myLineBreak = true; } else if (myCodePoint == '\r') { char secondChar = myElementEndOffset < myText.length() ? ... | setCharElement |
243,729 | void (int offset) { if (offset >= myElementStartOffset) return; if (offset >= myIterationState.getStartOffset()) { myElementStartOffset = offset; setCharElement(); } else { myIterationState.retreat(offset); setElementOffsets(); } } | retreat |
243,730 | int () { return myElementStartOffset; } | getElementStartOffset |
243,731 | int () { return myElementEndOffset; } | getElementEndOffset |
243,732 | boolean () { return myLineBreak; } | isLineBreak |
243,733 | FoldRegion () { return myIterationState.getCurrentFold(); } | getCurrentFold |
243,734 | boolean () { return getCurrentFold() != null; } | isFoldRegion |
243,735 | int () { return myCodePoint; } | getCodePoint |
243,736 | boolean () { return !isFoldRegion() && (myCodePoint == ' ' || myCodePoint == '\t'); } | isWhitespace |
243,737 | int () { return myLogicalLine; } | getLogicalLine |
243,738 | boolean () { return myElementEndOffset == myIterationState.getEndOffset() && myIterationState.nextIsFoldRegion(); } | nextIsFoldRegion |
243,739 | int () { return myIterationState.getMergedAttributes().getFontType(); } | getFontStyle |
243,740 | int (@NotNull Graphics g, @NotNull SoftWrapDrawingType drawingType, int x, int y, int lineHeight) { initDelegateIfNecessary(); return myDelegate.paint(g, drawingType, x, y, lineHeight); } | paint |
243,741 | int (@NotNull Graphics g, @NotNull SoftWrapDrawingType drawingType, int x, int y, int lineHeight) { initDelegateIfNecessary(); return myDelegate.getDrawingHorizontalOffset(g, drawingType, x, y, lineHeight); } | getDrawingHorizontalOffset |
243,742 | int (@NotNull SoftWrapDrawingType drawingType) { initDelegateIfNecessary(); return myDelegate.getMinDrawingWidth(drawingType); } | getMinDrawingWidth |
243,743 | boolean () { return true; } | canUse |
243,744 | void () { if (myDelegate != null && myDelegate.canUse()) { return; } if (++mySymbolsDrawingIndex < SYMBOLS.size()) { TextDrawingCallback callback = myEditor.getTextDrawingCallback(); ColorProvider colorHolder = ColorProvider.byColorScheme(myEditor, EditorColors.SOFT_WRAP_SIGN_COLOR); myDelegate = new TextBasedSoftWrapP... | initDelegateIfNecessary |
243,745 | void () { myDelegate = null; mySymbolsDrawingIndex = -1; } | reinit |
243,746 | int (@NotNull Graphics g, @NotNull SoftWrapDrawingType drawingType, int x, int y, int lineHeight) { FontInfo fontInfo = myFonts.get(drawingType); if (fontInfo != null) { char[] buffer = mySymbols.get(drawingType); int vGap = myVGaps.get(drawingType); myDrawingCallback.drawChars(g, buffer, 0, buffer.length, x, y + lineH... | paint |
243,747 | int (@NotNull Graphics g, @NotNull SoftWrapDrawingType drawingType, int x, int y, int lineHeight) { return getMinDrawingWidth(drawingType); } | getDrawingHorizontalOffset |
243,748 | int (@NotNull SoftWrapDrawingType drawingType) { return myWidths[drawingType.ordinal()]; } | getMinDrawingWidth |
243,749 | boolean () { return myCanUse; } | canUse |
243,750 | void () { // We use dummy component here in order to be able to work with font metrics. JLabel component = new JLabel(); myCanUse = true; for (Map.Entry<SoftWrapDrawingType, char[]> entry : mySymbols.entrySet()) { SoftWrapDrawingType type = entry.getKey(); char c = entry.getValue()[0]; FontInfo fontInfo = EditorUtil.fo... | reinit |
243,751 | void () { recalculateIfNecessary(); } | registerSoftWrapIfNecessary |
243,752 | void () { myIsDirty = true; for (SoftWrapAwareDocumentParsingListener listener : myListeners) { listener.reset(); } } | reset |
243,753 | void (IncrementalCacheUpdateEvent e) { if (myIsDirty) { return; } if (myVisibleAreaWidth <= 0) { myIsDirty = true; return; } recalculateSoftWraps(e); onRecalculationEnd(); } | recalculate |
243,754 | void (@NotNull List<? extends Segment> ranges) { if (myIsDirty) { return; } if (myVisibleAreaWidth <= 0) { myIsDirty = true; return; } ranges.sort((o1, o2) -> { int startDiff = o1.getStartOffset() - o2.getStartOffset(); return startDiff == 0 ? o2.getEndOffset() - o1.getEndOffset() : startDiff; }); final int[] lastRecal... | recalculate |
243,755 | void (@NotNull IncrementalCacheUpdateEvent event) { lastRecalculatedOffset[0] = event.getActualEndOffset(); } | onRecalculationEnd |
243,756 | void () { reset(); myStorage.removeAll(); myVisibleAreaWidth = myAvailableWidth; myCustomIndentUsedLastTime = myEditor.getSettings().isUseCustomSoftWrapIndent(); myCustomIndentValueUsedLastTime = myEditor.getSettings().getCustomSoftWrapIndent(); recalculateSoftWraps(); } | recalculateAll |
243,757 | boolean () { if (!myIsDirty) { return true; } if (myVisibleAreaWidth <= 0) { return false; } myIsDirty = false; recalculateSoftWraps(new IncrementalCacheUpdateEvent(myEditor.getDocument())); onRecalculationEnd(); return true; } | recalculateSoftWraps |
243,758 | void () { updateLastTopLeftCornerOffset(); for (SoftWrapAwareDocumentParsingListener listener : myListeners) { listener.recalculationEnds(); } } | onRecalculationEnd |
243,759 | void (@NotNull IncrementalCacheUpdateEvent event) { if (myInProgress) { LOG.error("Detected race condition at soft wraps recalculation", new Throwable(), AttachmentFactory.createContext(myEditor.dumpState() + "\n" + event)); } myInProgress = true; try { myEventBeingProcessed = event; notifyListenersOnCacheUpdateStart(e... | recalculateSoftWraps |
243,760 | void (IncrementalCacheUpdateEvent event) { Document document = myEditor.getDocument(); int lineCount = document.getLineCount(); int offset = event.getStartOffset(); int line = document.getLineNumber(offset); int mandatoryEnd = event.getMandatoryEndOffset(); while (true) { if ((offset += QUICK_WRAP_CHAR_COUNT) >= docume... | doRecalculateSoftWrapsRoughly |
243,761 | int (IncrementalCacheUpdateEvent event) { int endOffsetUpperEstimate = EditorUtil.getNotFoldedLineEndOffset(myEditor, event.getMandatoryEndOffset()); int line = myEditor.getDocument().getLineNumber(endOffsetUpperEstimate); if (line < myEditor.getDocument().getLineCount() - 1) { endOffsetUpperEstimate = myEditor.getDocu... | getEndOffsetUpperEstimate |
243,762 | boolean () { if (myInProgress) { return false; } // Check if we need to recalculate soft wraps due to indent settings change. boolean indentChanged = false; IndentType currentIndentType = getIndentToUse(); boolean useCustomIndent = currentIndentType == IndentType.CUSTOM; int currentCustomIndent = myEditor.getSettings()... | recalculateIfNecessary |
243,763 | void () { int visibleAreaTopY = myEditor.getScrollingModel().getVisibleArea().y; if (visibleAreaTopY == 0) { myLastTopLeftCornerOffset = 0; } else { int visualLine = 1 + myEditor.yToVisualLine(visibleAreaTopY); myLastTopLeftCornerOffset = myEditor.visualLineStartOffset(visualLine); } } | updateLastTopLeftCornerOffset |
243,764 | int (int offset) { final int i = myStorage.getSoftWrapIndex(offset); return i >= 0 ? i : -i - 1; } | getNumberOfSoftWrapsBefore |
243,765 | IndentType () { return myEditor.getSettings().isUseCustomSoftWrapIndent() ? IndentType.CUSTOM : IndentType.NONE; } | getIndentToUse |
243,766 | boolean (@NotNull SoftWrapAwareDocumentParsingListener listener) { return myListeners.add(listener); } | addListener |
243,767 | boolean (@NotNull SoftWrapAwareDocumentParsingListener listener) { return myListeners.remove(listener); } | removeListener |
243,768 | void (IncrementalCacheUpdateEvent event) { //noinspection ForLoopReplaceableByForEach for (int i = 0; i < myListeners.size(); i++) { // Avoid unnecessary Iterator object construction as this method is expected to be called frequently. SoftWrapAwareDocumentParsingListener listener = myListeners.get(i); listener.onCacheU... | notifyListenersOnCacheUpdateStart |
243,769 | void (IncrementalCacheUpdateEvent event) { //noinspection ForLoopReplaceableByForEach for (int i = 0; i < myListeners.size(); i++) { // Avoid unnecessary Iterator object construction as this method is expected to be called frequently. SoftWrapAwareDocumentParsingListener listener = myListeners.get(i); listener.onRecalc... | notifyListenersOnCacheUpdateEnd |
243,770 | void (DocumentEvent event) { myDocumentChangedEvent = new IncrementalCacheUpdateEvent(event, myEditor); } | beforeDocumentChange |
243,771 | void (DocumentEvent event, boolean processAlsoLineEnd) { LOG.assertTrue(myDocumentChangedEvent != null); recalculate(myDocumentChangedEvent); if (processAlsoLineEnd) { int lineEndOffset = DocumentUtil.getLineEndOffset(myDocumentChangedEvent.getMandatoryEndOffset(), event.getDocument()); if (lineEndOffset > myDocumentCh... | documentChanged |
243,772 | void (@NotNull VisibleAreaWidthProvider widthProvider) { myWidthProvider = widthProvider; reset(); } | setWidthProvider |
243,773 | VisibleAreaWidthProvider () { return myWidthProvider; } | getWidthProvider |
243,774 | String () { return String.format( "recalculation in progress: %b; event being processed: %s, available width: %d, visible width: %d, dirty: %b", myInProgress, myEventBeingProcessed, myAvailableWidth, myVisibleAreaWidth, myIsDirty ); } | dumpState |
243,775 | String () { return dumpState(); } | toString |
243,776 | void (SoftWrapPainter painter) { myPainter = painter; } | setSoftWrapPainter |
243,777 | void () { Rectangle visibleArea = myEditor.getScrollingModel().getVisibleArea(); if (visibleArea.isEmpty()) return; int width = myWidthProvider.getVisibleAreaWidth(); if (width <= 0) return; myAvailableWidth = width; } | updateAvailableArea |
243,778 | int () { JScrollBar scrollBar = myEditor.getScrollPane().getVerticalScrollBar(); int width = scrollBar.getWidth(); if (width <= 0) { width = scrollBar.getPreferredSize().width; } return width; } | getVerticalScrollBarWidth |
243,779 | int () { Insets insets = myEditor.getContentComponent().getInsets(); int horizontalInsets = insets.left + insets.right; // We don't want soft-wrapped text to go under the scroll bar even if that feature is enabled, // because in this case the scrollbar sometimes prevents the user from placing the caret by // clicking i... | getVisibleAreaWidth |
243,780 | boolean (SoftWrap newSoftWrap, int lengthDiff) { return Collections.binarySearch(myAffectedByUpdateSoftWraps, new SoftWrapImpl(new TextChangeImpl(newSoftWrap.getText(), newSoftWrap.getStart() - lengthDiff, newSoftWrap.getEnd() - lengthDiff), newSoftWrap.getIndentInColumns(), newSoftWrap.getIndentInPixels()), (o1, o2) -... | matchesOldSoftWrap |
243,781 | void () { } | recalculationEnds |
243,782 | void (@NotNull IncrementalCacheUpdateEvent event) { int startOffset = event.getStartOffset(); myAffectedByUpdateSoftWraps.clear(); myAffectedByUpdateSoftWraps.addAll(myStorage.removeStartingFrom(startOffset + 1)); } | onCacheUpdateStart |
243,783 | void (@NotNull IncrementalCacheUpdateEvent event) { advanceSoftWrapOffsets(event); } | onRecalculationEnd |
243,784 | void () { myAffectedByUpdateSoftWraps.clear(); } | reset |
243,785 | void (@NotNull IncrementalCacheUpdateEvent event) { int lengthDiff = event.getLengthDiff(); int recalcEndOffsetTranslated = event.getActualEndOffset() - lengthDiff; int firstIndex = -1; int softWrappedLinesDiff = myStorage.getNumberOfSoftWrapsInRange(event.getStartOffset() + 1, myEditor.getDocument().getTextLength()); ... | advanceSoftWrapOffsets |
243,786 | String () { return "Soft wraps affected by current update: " + myAffectedByUpdateSoftWraps; } | dumpState |
243,787 | String () { return dumpState(); } | toString |
243,788 | VisualLineInfo (@NotNull EditorImpl editor, int offset, boolean beforeSoftWrap) { Document document = editor.getDocument(); int textLength = document.getTextLength(); if (offset <= 0 || textLength == 0) return new VisualLineInfo(0, false); offset = Math.min(offset, textLength); int startOffset = EditorUtil.getNotFolded... | getVisualLineInfo |
243,789 | int () { return myStartOffset; } | getStartOffset |
243,790 | int () { return myMandatoryEndOffset; } | getMandatoryEndOffset |
243,791 | int () { return myActualEndOffset; } | getActualEndOffset |
243,792 | void (int actualEndOffset) { myActualEndOffset = actualEndOffset; } | setActualEndOffset |
243,793 | int () { return myLengthDiff; } | getLengthDiff |
243,794 | String () { return "startOffset=" + myStartOffset + ", mandatoryEndOffset=" + myMandatoryEndOffset + ", actualEndOffset=" + myActualEndOffset + ", lengthDiff=" + myLengthDiff; } | toString |
243,795 | void (@NotNull IncrementalCacheUpdateEvent event) { } | onCacheUpdateStart |
243,796 | void (@NotNull IncrementalCacheUpdateEvent event) { } | onRecalculationEnd |
243,797 | void () { } | recalculationEnds |
243,798 | void () { } | reset |
243,799 | GutterIconRenderer () { return myGutterIconRenderer; } | getGutterIconRenderer |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.