Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
241,100
void (@NotNull Editor editor, @NotNull SelectionListener listener, @NotNull Disposable disposable) { Ref<Pair<int[], int[]>> selectionBeforeBulkChange = new Ref<>(); Ref<Boolean> selectionChangedDuringBulkChange = new Ref<>(); editor.getSelectionModel().addSelectionListener(new SelectionListener() { @Override public vo...
addBulkSelectionListener
241,101
void (@NotNull SelectionEvent e) { if (selectionBeforeBulkChange.isNull()) { listener.selectionChanged(e); } else { selectionChangedDuringBulkChange.set(Boolean.TRUE); } }
selectionChanged
241,102
void () { selectionBeforeBulkChange.set(getSelectionOffsets()); selectionChangedDuringBulkChange.set(null); }
beforeAllCaretsAction
241,103
void () { if (!selectionChangedDuringBulkChange.isNull()) { Pair<int[], int[]> beforeBulk = selectionBeforeBulkChange.get(); Pair<int[], int[]> afterBulk = getSelectionOffsets(); listener.selectionChanged(new SelectionEvent(editor, beforeBulk.first, beforeBulk.second, afterBulk.first, afterBulk.second)); } selectionBef...
afterAllCaretsAction
241,104
void (@NotNull Runnable task) { if (CommandProcessor.getInstance().getCurrentCommand() == null) return; MessageBusConnection connection = ApplicationManager.getApplication().getMessageBus().connect(); connection.subscribe(CommandListener.TOPIC, new CommandListener() { @Override public void beforeCommandFinished(@NotNul...
performBeforeCommandEnd
241,105
void (@NotNull CommandEvent event) { task.run(); }
beforeCommandFinished
241,106
void (@NotNull CommandEvent event) { connection.disconnect(); }
commandFinished
241,107
boolean (@NotNull Editor editor) { return ReadAction.compute(() -> { Rectangle visibleArea = editor.getScrollingModel().getVisibleArea(); Caret caret = editor.getCaretModel().getPrimaryCaret(); Point caretPoint = editor.visualPositionToXY(caret.getVisualPosition()); return visibleArea.contains(caretPoint); }); }
isPrimaryCaretVisible
241,108
boolean (@NotNull Editor editor, @NotNull Point point) { return ReadAction.compute(() -> { VisualPosition visualPosition = editor.xyToVisualPosition(point); int visualLineStartY = editor.visualLineToY(visualPosition.line); if (point.y < visualLineStartY || point.y >= visualLineStartY + editor.getLineHeight()) return fa...
isPointOverText
241,109
void (@NotNull Editor editor) { Long lastTimeStamp = editor.getUserData(EditorNotification.LAST_MAX_CARETS_NOTIFY_TIMESTAMP); long currentTimeStamp = System.currentTimeMillis(); if (lastTimeStamp != null && (currentTimeStamp - lastTimeStamp) < EditorNotification.MAX_CARETS_NOTIFY_INTERVAL_MS) return; editor.putUserData...
notifyMaxCarets
241,110
boolean (@NotNull Editor editor) { return ReadAction.compute(() -> { CaretModel caretModel = editor.getCaretModel(); if (caretModel.getCaretCount() >= caretModel.getMaxCaretCount()) { notifyMaxCarets(editor); return true; } return false; }); }
checkMaxCarets
241,111
boolean (@Nullable Caret caret) { return ReadAction.compute(() -> caret != null && caret.hasSelection() && caret.getOffset() >= caret.getSelectionStart() && caret.getOffset() <= caret.getSelectionEnd()); }
isCaretInsideSelection
241,112
boolean (@NotNull AnActionEvent e) { return ReadAction.compute(() -> { if (!ActionPlaces.EDITOR_POPUP.equals(e.getPlace())) return false; Editor editor = e.getData(CommonDataKeys.EDITOR); return editor != null && editor.getSelectionModel().hasSelection() && !isCaretInsideSelection(e.getData(CommonDataKeys.CARET)); }); ...
contextMenuInvokedOutsideOfSelection
241,113
DataContext (@NotNull Editor editor) { DataContext context = DataManager.getInstance().getDataContext(editor.getContentComponent()); if (PROJECT.getData(context) == editor.getProject()) { return context; } return CustomizedDataContext.create(context, dataId -> { if (PROJECT.is(dataId)) { return Objects.requireNonNullEl...
getEditorDataContext
241,114
boolean () { return UISettings.getInstance().getShowBreakpointsOverLineNumbers() && !UISettings.getInstance().getPresentationMode() && !Registry.is("editor.distraction.free.mode"); }
isBreakPointsOnLineNumbers
241,115
boolean (@NotNull final Caret caret) { return switch (caret.getVisualAttributes().getShape()) { case DEFAULT -> caret.getEditor().isInsertMode() == caret.getEditor().getSettings().isBlockCursor(); case BLOCK, BOX, UNDERSCORE -> true; case BAR -> caret.getVisualAttributes().getThickness() > 0.5f; }; }
isBlockLikeCaret
241,116
Keymap (@NotNull Keymap keymap) { while (keymap.canModify()) { Keymap parent = keymap.getParent(); if (parent == null) { break; } else { keymap = parent; } } return keymap; }
getRootKeymap
241,117
boolean (AWTEvent event) { if (!(event instanceof KeyEvent keyEvent)) return false; int modifiers = keyEvent.getModifiers(); return (keyEvent.getKeyCode() == KeyEvent.VK_Y && ((modifiers & InputEvent.CTRL_MASK) != 0) && ((modifiers & InputEvent.SHIFT_MASK) == 0) && ((modifiers & InputEvent.ALT_GRAPH_MASK) == 0) && ((mo...
isCtrlY
241,118
void (@NotNull Keymap currentKeymap) { KeymapManager keymapManager = KeymapManager.getInstance(); assert keymapManager instanceof KeymapManagerEx; Keymap[] allKeymaps = ((KeymapManagerEx)keymapManager).getAllKeymaps(); String name = SchemeNameGenerator.getUniqueName(KeyMapBundle.message("keymap.with.patched.redo.name",...
patchKeymap
241,119
void (DataContext dataContext) { AnAction action = ActionManager.getInstance().getAction(IdeActions.ACTION_REDO); if (action != null) ActionUtil.invokeAction(action, dataContext, ActionPlaces.MAIN_MENU, null, null); }
invokeRedo
241,120
boolean (DataContext dataContext) { if (!PropertiesComponent.getInstance().isValueSet(ASK_ABOUT_SHORTCUT)) return true; Keymap keymap = getCurrentKeymap(); if (keymap == null) return true; Keymap rootKeymap = getRootKeymap(keymap); if (!TARGET_KEYMAPS.contains(rootKeymap.getName())) return true; AWTEvent event = IdeEve...
isCurrentShortcutOk
241,121
void () { PropertiesComponent.getInstance().setValue(ASK_ABOUT_SHORTCUT, true); }
askAboutShortcut
241,122
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { EditorActionUtil.scrollRelatively(editor, 0, -1, false); }
doExecute
241,123
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { EditorActionUtil.scrollRelatively(editor, 1, 0, true); }
doExecute
241,124
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { if (editor.getSelectionModel().hasSelection()) { int selStart = editor.getSelectionModel().getSelectionStart(); int selEnd = editor.getSelectionModel().getSelectionEnd(); if (selEnd > selStart && DocumentUtil.isAtLineStart(selEnd, editor.get...
executeWriteAction
241,125
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return !editor.isViewer(); }
isEnabledForCaret
241,126
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { // We capture the contents to paste here, so it that it won't be affected by possible clipboard operations later (e.g. during unlocking // of current file for writing) myTransferable = getContentsToPaste(editor, dataContext); try { super.do...
doExecute
241,127
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { if (myTransferable != null) { EditorCopyPasteHelper.getInstance().pasteTransferable(editor, myTransferable); } }
executeWriteAction
241,128
Transferable (Editor editor, DataContext dataContext) { Producer<Transferable> producer = PasteAction.TRANSFERABLE_PROVIDER.getData(dataContext); return EditorModificationUtil.getContentsToPasteToEditor(producer); }
getContentsToPaste
241,129
boolean (int contentLength) { return contentLength > FileUtilRt.LARGE_FOR_CONTENT_LOADING; }
isContentTooLarge
241,130
void (int contentLength) { Messages.showErrorDialog(EditorBundle.message("content.to.paste.too.large.message", StringUtil.formatFileSize(contentLength), StringUtil.formatFileSize(FileUtilRt.LARGE_FOR_CONTENT_LOADING)), EditorBundle.message("content.to.paste.too.large.title")); }
contentLengthLimitExceededMessage
241,131
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { EditorActionUtil.moveCaretPageTop(editor, false); }
doExecute
241,132
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { EditorActionUtil.scrollRelatively(editor, 0, 1, false); }
doExecute
241,133
void (@NotNull Editor editor, int start, int end) { copyToKillRing(editor, start, end, true); editor.getDocument().deleteString(start, end); }
cut
241,134
void (final @NotNull Editor editor, int startOffset, int endOffset, boolean cut) { Document document = editor.getDocument(); String s = document.getCharsSequence().subSequence(startOffset, endOffset).toString(); s = StringUtil.convertLineSeparators(s); CopyPasteManager.getInstance().setContents(new KillRingTransferable...
copyToKillRing
241,135
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { EditorActionUtil.moveCaretToLineEnd(editor, false, !(editor instanceof TextComponentEditor)); }
doExecute
241,136
void (final @NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { if (!editor.getCaretModel().supportsMultipleCarets()) { EditorActionUtil.moveCaretPageDown(editor, true); return; } if (editor.isColumnMode()) { int lines = editor.getScrollingModel().getVisibleArea().height / editor.getLineHeight(); ...
doExecute
241,137
void (@NotNull AnActionEvent e) { if (myGlobal) { Editor editor = getEditor(e); if (editor != null) { EditorSettings settings = editor.getSettings(); if (settings instanceof SettingsImpl && ((SettingsImpl)settings).getSoftWrapAppliancePlace() != myAppliancePlace) { e.getPresentation().setEnabledAndVisible(false); retur...
update
241,138
boolean (@NotNull AnActionEvent e) { Editor editor = getEditor(e); if (myGlobal) { boolean selected = EditorSettingsExternalizable.getInstance().isUseSoftWraps(myAppliancePlace); selected |= (editor != null && Boolean.TRUE.equals(editor.getUserData(EditorImpl.FORCED_SOFT_WRAPS))); return selected; } return editor != nu...
isSelected
241,139
void (@NotNull AnActionEvent e, boolean state) { final Editor editor = getEditor(e); if (editor == null) { return; } toggleSoftWraps(editor, myGlobal && !Boolean.TRUE.equals(editor.getUserData(EditorImpl.FORCED_SOFT_WRAPS)) ? myAppliancePlace : null, state); }
setSelected
241,140
void (@NotNull Editor editor, @Nullable SoftWrapAppliancePlaces places, boolean state) { Point point = editor.getScrollingModel().getVisibleArea().getLocation(); LogicalPosition anchorPosition = editor.xyToLogicalPosition(point); int intraLineShift = point.y - editor.logicalPositionToXY(anchorPosition).y; if (places !=...
toggleSoftWraps
241,141
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { if (editor.isColumnMode() && caret == null && editor.getCaretModel().getCaretCount() > 1) { EditorUIUtil.hideCursorInEditor(editor); CommandProcessor.getInstance().setCurrentCommandGroupId(EditorActionUtil.DELETE_COMMAND_GROUP); CopyPasteMa...
executeWriteAction
241,142
int (Editor editor, TextRange textRange) { return ConvertIndentsUtil.convertIndentsToSpaces(editor.getDocument(), editor.getSettings().getTabSize(editor.getProject()), textRange); }
performAction
241,143
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { editor.getSelectionModel().selectLineAtCaret(); EditorActionUtil.moveCaretToLineStartIgnoringSoftWraps(editor); }
doExecute
241,144
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { final Document document = editor.getDocument(); int caretOffset = editor.getCaretModel().getOffset(); if (caretOffset <= 0) { return; } // The main idea is to kill everything between the current line start and caret and the whole previous l...
executeWriteAction
241,145
boolean (@NotNull AnActionEvent e) { Document document = myEditor.getDocument(); return document.getLineCount() == 0 || document.getLineNumber(myEditor.getCaretModel().getOffset()) == document.getLineCount() - 1; }
isSelected
241,146
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
241,147
void (@NotNull AnActionEvent e, boolean state) { if (state) { EditorUtil.scrollToTheEnd(myEditor); } else { int lastLine = Math.max(0, myEditor.getDocument().getLineCount() - 1); LogicalPosition currentPosition = myEditor.getCaretModel().getLogicalPosition(); LogicalPosition position = new LogicalPosition(Math.max(0, M...
setSelected
241,148
void (final @NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { copyToClipboard(editor, dataContext, EditorCopyPasteHelper.getInstance()::getSelectionTransferable); }
doExecute
241,149
record (@NotNull CopyPasteOptions copyPasteOptions, @Nullable List<CaretState> caretStateToRestore) { private static final @NotNull DataKey<SelectionToCopy> KEY = DataKey.create("CopyAction.SelectionToCopy.KEY"); public static @Nullable SelectionToCopy fromDataContext(@NotNull DataContext dataContext) { return KEY.getD...
SelectionToCopy
241,150
DataContext (@NotNull DataContext dataContext) { return CustomizedDataContext.create(dataContext, dataId -> KEY.is(dataId) ? this : null); }
extendDataContext
241,151
void (@NotNull Editor editor, @NotNull DataContext dataContext, @NotNull TransferableProvider transferableProvider) { SelectionToCopy selectionToCopy = SelectionToCopy.fromDataContext(dataContext); if (selectionToCopy == null) { // a genuine "Copy", not "Cut" selectionToCopy = prepareSelectionToCopy(editor); if (select...
copyToClipboard
241,152
void (@NotNull Editor editor, @NotNull TransferableProvider transferableProvider, @NotNull SelectionToCopy selectionToCopy) { Transferable transferable = transferableProvider.getSelection(editor, selectionToCopy.copyPasteOptions()); if (transferable != null) { CopyPasteManager.getInstance().setContents(transferable); i...
copyToClipboard
241,153
void (@NotNull Editor editor, @NotNull SelectionToCopy selectionToCopy) { List<CaretState> originalCaretState = selectionToCopy.caretStateToRestore(); if (originalCaretState != null) { Project project = editor.getProject(); if (project != null) { highlightSelections(editor, project); } editor.getCaretModel().setCaretsA...
restoreCaretStateIfNeeded
241,154
void (@NotNull Editor editor, @NotNull Project project) { HighlightManager highlightManager = HighlightManager.getInstance(project); editor.getCaretModel().runForEachCaret(caret -> { if (caret.hasSelection()) { highlightManager.addOccurrenceHighlight(editor, caret.getSelectionStart(), caret.getSelectionEnd(), EditorCol...
highlightSelections
241,155
boolean () { return AdvancedSettings.getBoolean(SKIP_COPY_AND_CUT_FOR_EMPTY_SELECTION_KEY); }
isSkipCopyPasteForEmptySelection
241,156
boolean () { return !AdvancedSettings.getBoolean(SKIP_SELECTING_LINE_AFTER_COPY_EMPTY_SELECTION_KEY); }
isCopyFromEmptySelectionToSelectLine
241,157
boolean () { return Registry.is("editor.action.copy.entireLineFromEmptySelection.moveCaretToLineStart"); }
isCopyFromEmptySelectionToMoveCaretToLineStart
241,158
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { EditorActionUtil.selectEntireLines(caret); final int end = caret.getSelectionEnd(); caret.moveToOffset(end); }
doExecute
241,159
void (final @NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { int lineShift = myDirection == MoveCaretUpOrDownHandler.Direction.DOWN ? 1 : -1; if (!editor.getCaretModel().supportsMultipleCarets()) { editor.getCaretModel().moveCaretRelatively(0, lineShift, true, editor.isColumnMode(), true); retu...
doExecute
241,160
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { CommandProcessor.getInstance().setCurrentCommandGroupId(EditorActionUtil.EDIT_COMMAND_GROUP); CommandProcessor.getInstance().setCurrentCommandName(EditorBundle.message("typing.command.name")); Project project = CommonDataKeys.PROJECT.getData...
executeWriteAction
241,161
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return !editor.isOneLineMode() && !((EditorEx)editor).isEmbeddedIntoDialogWrapper() && !editor.isViewer(); }
isEnabledForCaret
241,162
void (Editor editor, @NotNull Caret caret, @Nullable Project project) { EditorUIUtil.hideCursorInEditor(editor); int columnNumber; if (caret.hasSelection()) { columnNumber = editor.visualToLogicalPosition(caret.getSelectionStartPosition()).column; } else { columnNumber = editor.getCaretModel().getLogicalPosition().colu...
insertTabAtCaret
241,163
void (@NotNull Editor editor, int lineShift, int columnShift, boolean moveCaret) { if (lineShift != 0) { editor.getScrollingModel().scrollVertically( editor.getScrollingModel().getVerticalScrollOffset() + lineShift * editor.getLineHeight() ); } if (columnShift != 0) { editor.getScrollingModel().scrollHorizontally( edit...
scrollRelatively
241,164
void (@NotNull Editor editor, int columnShift, int lineShift, boolean withSelection) { Rectangle visibleArea = getVisibleArea(editor); VisualPosition pos = editor.getCaretModel().getVisualPosition(); Point caretLocation = editor.visualPositionToXY(pos); int caretVShift = caretLocation.y - visibleArea.y; editor.getCaret...
moveCaretRelativelyAndScroll
241,165
void (Project project, @NotNull Editor editor, int lineNumber, int indent) { int caretOffset = editor.getCaretModel().getOffset(); int newCaretOffset = indentLine(project, editor, lineNumber, indent, caretOffset); editor.getCaretModel().moveToOffset(newCaretOffset); }
indentLine
241,166
int (Project project, @NotNull Editor editor, int lineNumber, int indent, int caretOffset) { return EditorCoreUtil.indentLine(project, editor, lineNumber, indent, caretOffset, shouldUseSmartTabs(project, editor)); }
indentLine
241,167
boolean (Project project, @NotNull Editor editor) { if (!(editor instanceof EditorEx)) return false; return CodeStyle.getIndentOptions(project, editor.getDocument()).SMART_TABS; }
shouldUseSmartTabs
241,168
void (@NotNull Caret caret) { selectEntireLines(caret, false); }
selectEntireLines
241,169
void (@NotNull Caret caret, boolean resetToSingleLineAtCaret) { Editor editor = caret.getEditor(); int lineNumber = caret.getLogicalPosition().line; Document document = editor.getDocument(); if (lineNumber >= document.getLineCount()) { return; } TextRange range = EditorUtil.calcSurroundingTextRange(editor, resetToSingl...
selectEntireLines
241,170
TextRange (@NotNull Editor editor, boolean isCamel, boolean handleQuoted) { int startOffset = editor.getCaretModel().getOffset(); // IDEA-211756 "Delete to word end" is extremely inconvenient on whitespaces int endOffset = getNextCaretStopOffset(editor, CaretStopPolicy.BOTH, isCamel, handleQuoted); return TextRange.cre...
getRangeToWordEnd
241,171
TextRange (@NotNull Editor editor, boolean isCamel, boolean handleQuoted) { int endOffset = editor.getCaretModel().getOffset(); int startOffset = getPreviousCaretStopOffset(editor, CaretStopPolicy.WORD_START, isCamel, handleQuoted); return TextRange.create(startOffset, endOffset); }
getRangeToWordStart
241,172
int (@NotNull Editor editor, @NotNull CaretStopPolicy caretStopPolicy, boolean isCamel) { return getNextCaretStopOffset(editor, caretStopPolicy, isCamel, false); }
getNextCaretStopOffset
241,173
int (@NotNull Editor editor, @NotNull CaretStopPolicy caretStopPolicy, boolean isCamel) { return getPreviousCaretStopOffset(editor, caretStopPolicy, isCamel, false); }
getPreviousCaretStopOffset
241,174
int (@NotNull Editor editor, @NotNull CaretStopPolicy caretStopPolicy, boolean isCamel, boolean handleQuoted) { int maxOffset = getNextLineStopOffset(editor, caretStopPolicy.getLineStop()); final CaretStop wordStop = caretStopPolicy.getWordStop(); if (wordStop.equals(CaretStop.NONE)) return maxOffset; final int offset ...
getNextCaretStopOffset
241,175
int (@NotNull Editor editor, @NotNull CaretStopPolicy caretStopPolicy, boolean isCamel, boolean handleQuoted) { int minOffset = getPreviousLineStopOffset(editor, caretStopPolicy.getLineStop()); final CaretStop wordStop = caretStopPolicy.getWordStop(); if (wordStop.equals(CaretStop.NONE)) return minOffset; final int off...
getPreviousCaretStopOffset
241,176
int (@NotNull CharSequence text, @NotNull CaretStop wordStop, @NotNull HighlighterIterator tokenIterator, int offset, int maxOffset, boolean isCamel) { int newOffset = offset + 1; for (; newOffset < maxOffset; newOffset++) { final boolean isTokenBoundary = advanceTokenOnBoundary(tokenIterator, text, newOffset); if (isW...
getNextWordStopOffset
241,177
int (@NotNull CharSequence text, @NotNull CaretStop wordStop, @NotNull HighlighterIterator tokenIterator, int offset, int minOffset, boolean isCamel) { int newOffset = offset - 1; for (; newOffset > minOffset; newOffset--) { final boolean isTokenBoundary = retreatTokenOnBoundary(tokenIterator, text, newOffset); if (isW...
getPreviousWordStopOffset
241,178
boolean (@NotNull CharSequence text, @NotNull CaretStop wordStop, int offset, boolean isCamel, boolean isLexemeBoundary) { if (wordStop.isAtStart() && wordStop.isAtEnd()) { return isLexemeBoundary || isWordStart(text, offset, isCamel) || isWordEnd(text, offset, isCamel); } if (wordStop.isAtStart()) return isLexemeBound...
isWordStopOffset
241,179
boolean (@NotNull HighlighterIterator tokenIterator, @NotNull CharSequence text, int offset) { if (tokenIterator.atEnd()) return false; if (isTokenEnd(tokenIterator, offset)) { final IElementType leftToken = tokenIterator.getTokenType(); final boolean wasQuotedToken = isQuotedToken(tokenIterator, text); tokenIterator.a...
advanceTokenOnBoundary
241,180
boolean (@NotNull HighlighterIterator tokenIterator, @NotNull CharSequence text, int offset) { if (tokenIterator.atEnd()) return false; if (isTokenStart(tokenIterator, offset)) { final IElementType rightToken = tokenIterator.getTokenType(); final boolean wasQuotedToken = isQuotedToken(tokenIterator, text); tokenIterato...
retreatTokenOnBoundary
241,181
boolean (@NotNull HighlighterIterator tokenIterator, @NotNull CharSequence text, int offset) { return (isTokenStart(tokenIterator, offset - 1) || isTokenEnd(tokenIterator, offset + 1)) && isQuotedToken(tokenIterator, text); }
isQuotedTokenInnardsBoundary
241,182
boolean (@NotNull HighlighterIterator tokenIterator, int offset) { return offset == tokenIterator.getStart(); }
isTokenStart
241,183
boolean (@NotNull HighlighterIterator tokenIterator, int offset) { return offset == tokenIterator.getEnd(); }
isTokenEnd
241,184
boolean (@NotNull HighlighterIterator tokenIterator, @NotNull CharSequence text) { final int startOffset = tokenIterator.getStart(); final int endOffset = tokenIterator.getEnd(); if (endOffset - startOffset < 2) return false; final char openingQuote = getQuoteAt(text, startOffset); final char closingQuote = getQuoteAt(...
isQuotedToken
241,185
char (@NotNull CharSequence text, int offset) { if (offset < 0 || offset >= text.length()) return 0; final char ch = text.charAt(offset); return (ch == '\'' || ch == '\"') ? ch : 0; }
getQuoteAt
241,186
HighlighterIterator (@NotNull Editor editor, int offset) { return editor.getHighlighter().createIterator(offset); }
createHighlighterIteratorAtOffset
241,187
boolean (@Nullable IElementType leftTokenType, @Nullable IElementType rightTokenType) { return leftTokenType != null && rightTokenType != null && LanguageWordBoundaryFilter.INSTANCE.forLanguage(rightTokenType.getLanguage()) .isWordBoundary(leftTokenType, rightTokenType); }
isLexemeBoundary
241,188
int (@NotNull Editor editor, @NotNull CaretStop lineStop) { final Document document = editor.getDocument(); final CaretModel caretModel = editor.getCaretModel(); final int lineNumber = caretModel.getLogicalPosition().line; final boolean isAtLineEnd = (caretModel.getOffset() == document.getLineEndOffset(lineNumber)); re...
getNextLineStopOffset
241,189
int (@NotNull Document document, @NotNull CaretStop lineStop, int lineNumber, boolean isAtLineEnd) { if (lineNumber + 1 >= document.getLineCount()) { return document.getTextLength(); } else if (!isAtLineEnd) { return lineStop.isAtEnd() ? document.getLineEndOffset(lineNumber) : lineStop.isAtStart() ? document.getLineSta...
getNextLineStopOffset
241,190
int (@NotNull Editor editor, @NotNull CaretStop lineStop) { final Document document = editor.getDocument(); final CaretModel caretModel = editor.getCaretModel(); final int lineNumber = caretModel.getLogicalPosition().line; final boolean isAtLineStart = (caretModel.getOffset() == document.getLineStartOffset(lineNumber))...
getPreviousLineStopOffset
241,191
int (@NotNull Document document, @NotNull CaretStop lineStop, int lineNumber, boolean isAtLineStart) { if (lineNumber - 1 < 0) { return 0; } else if (!isAtLineStart) { return lineStop.isAtStart() ? document.getLineStartOffset(lineNumber) : lineStop.isAtEnd() ? document.getLineEndOffset(lineNumber - 1) : 0; } else { ret...
getPreviousLineStopOffset
241,192
boolean (@NotNull Editor editor, int offset, boolean isCamel) { CharSequence chars = editor.getDocument().getCharsSequence(); return isWordStart(chars, offset, isCamel) || !isWordEnd(chars, offset, isCamel) && isLexemeBoundary(editor, offset); }
isWordOrLexemeStart
241,193
boolean (@NotNull Editor editor, int offset, boolean isCamel) { CharSequence chars = editor.getDocument().getCharsSequence(); return isWordEnd(chars, offset, isCamel) || !isWordStart(chars, offset, isCamel) && isLexemeBoundary(editor, offset); }
isWordOrLexemeEnd
241,194
boolean (@NotNull Editor editor, int offset) { if (offset <= 0 || offset >= editor.getDocument().getTextLength() || DocumentUtil.isInsideSurrogatePair(editor.getDocument(), offset) || isBetweenWhitespaces(editor.getDocument().getCharsSequence(), offset)) { return false; } EditorHighlighter highlighter = editor.getHighl...
isLexemeBoundary
241,195
void (@NotNull Editor editor, boolean isWithSelection) { Document document = editor.getDocument(); SelectionModel selectionModel = editor.getSelectionModel(); int selectionStart = selectionModel.getLeadSelectionOffset(); CaretModel caretModel = editor.getCaretModel(); LogicalPosition blockSelectionStart = caretModel.ge...
moveCaretToLineStart
241,196
void (@NotNull Editor editor, VisualPosition currentVisual) { CaretModel caretModel = editor.getCaretModel(); int startLineOffset = editor.visualPositionToOffset(new VisualPosition(currentVisual.line, 0)); SoftWrapModel softWrapModel = editor.getSoftWrapModel(); SoftWrap softWrap = softWrapModel.getSoftWrap(startLineOf...
moveCaretToStartOfSoftWrappedLine
241,197
int (@NotNull Editor editor, int visualLine) { for (int i = visualLine; i >= 0; i--) { int column = findFirstNonSpaceColumnOnTheLine(editor, i); if (column >= 0) { return column; } } return 0; }
findSmartIndentColumn
241,198
int (@NotNull Editor editor, int visualLineNumber) { int startOffset = editor.visualPositionToOffset(new VisualPosition(visualLineNumber, 0)); int endOffset = EditorUtil.getNotFoldedLineEndOffset(editor, startOffset); int offset = findFirstNonSpaceOffsetInRange(editor.getDocument().getImmutableCharSequence(), startOffs...
findFirstNonSpaceColumnOnTheLine
241,199
int (@NotNull Document document, int lineNumber) { int lineStart = document.getLineStartOffset(lineNumber); int lineEnd = document.getLineEndOffset(lineNumber); int result = findFirstNonSpaceOffsetInRange(document.getCharsSequence(), lineStart, lineEnd); return result >= 0 ? result : lineEnd; }
findFirstNonSpaceOffsetOnTheLine